# Removes leading and trailing whitespace from a string in place.
#
# @param text [String] The string to modify.
# @return [String, nil] The modified string, or nil if no changes were made.
def trim_whitespace!(text)
text.strip!
end
input = " Hello, Ruby! "
trim_whitespace!(input)
puts "'#{input}'"
# run:
#
# 'Hello, Ruby!'
#