+ 2
Why i cant remove any character from string
see my code and tell what is wrong https://code.sololearn.com/cYJ36w1aaDC0/?ref=app
3 Answers
+ 2
+ is used to concatenate strings. - is not a valid operator for strings. If you want to shorten a string, take a look at String.substring(): https://docs.oracle.com/javase/7/docs/api/java/lang/String.html#substring(int,%20int)
+ 2
In many languages Strings are immutable. This means that each time the String is changed a new string must be made in order to replace the old one.