I am trying to complete my last program for intro to Java. Can anyone explain how to create a new string from an old one and take out the spaces from that string?
Strings
Collapse
X
-
Did you read the API documentation for the String class? I guess not otherwiseOriginally posted by sign711I am trying to complete my last program for intro to Java. Can anyone explain how to create a new string from an old one and take out the spaces from that string?
you would have noted a method replaceAll() which does exactly what you want.
kind regards,
JosComment
Comment