Java Strings Class
In this article we are reading about “ Java Strings Class ” . Strings, which are widely used in Java programming, are a sequence of characters. In Java programming language, strings are treated as objects. The Java platform provides the String class to create and manipulate strings. Creating Strings There are two ways to create string in Java: String literal String s = “SixwaresTechForum”; Using new keyword String s = new String (“SixwaresTechForum”); String Methods int length(): Returns the number of characters in the String. "SixwaresTechForum".length(); // returns 16 Char charAt(int i): Returns the character at i th index. "SixwaresTechForum".charAt(3); // returns ‘w’ String substring (int i): Return the substring from the i th index character to end. "SixwaresTechForum".substring(3); // returns “waresTechForum” String substring (int i, int j): Returns the substring from i to j-1...