Last Value From String

Geoffrey Challen // 2022.7.0

Write a method name lastValueFromString that accepts a String containing one or more lines, each containing an integer value, and returns the last value as an int. The values may have whitespace around them!

For example, given the String:


You should return 4.

You can assume that the passed String is not null, contains at least one line, and has no blank lines or lines that do not contain an integer value.