String common methods are there?

  • length (); // calculate the length of string

  • charAt (); // a character taken

  • getChars (); // a plurality of characters taken

  • equals (); // compare two strings

  • equalsIgnoreCase (); // compare two strings, ignoring case

  • startsWith (); // startsWith () method to decide whether to start a specific string

  • endWith (); // method to decide whether to end a particular string

  • indexOf (); // Find a local character or substring first appears.

  • lastIndexOf (); // find the character or substring is where the first occurrence.

  • substring (); // string interception

  • concat (); // connect two strings

  • replace (); // replace

  • trim (); // start and end spaces removed

  • valueOf (); // into a string

  • toLowerCase (); // lowercase

  • toUpperCase (); // converted to uppercase

Guess you like

Origin www.cnblogs.com/jing5464/p/11937280.html