How do the following methods differ: @my_string.strip and @my_string.strip! ?
Answer Posted / Ramniwas
"@my_string.strip removes leading and trailing whitespaces from a string, but it does not change the original string. On the other hand, @my_string.strip! modifies the original string by removing the leading and trailing whitespaces and returns nil."
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers