Strings I

Strings I

The most important thing to remember is that they are immutable and that they are a class type. In other words they aren’t a primitive type like int and char, because it is a class type you need to use theNameofStringvariable.equalTo.(“DiffrentString”),String.compareTo(“s”), instead of the comparison operators ==. >,<,<=, and >=. Which can also also allow for the Strings to have different cases if you add IgnoreCase to the end of To and before the dot with no spaces.

There are several methods in the String class like IndexOf(char/string) which finds the index of a given string or char, ,charAt(int) which is the opposite and finds character at a index, and things like trim() which takes off the white space at the begging and and of a string. For more methods go to the refrences and click the link to strings.