Created
September 18, 2012 15:19
-
-
Save jainmickey/3743710 to your computer and use it in GitHub Desktop.
Manipulation of strings in Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Use of Strings and substrings */ | |
class StringExample{ | |
public static void main(String args[]){ | |
String str = "Hello, World!"; //String is a inbuilt class which we can use through objects or instance variable | |
System.out.println("str is :- " + str); | |
/* substring is a method inside string class to manipulate strings. This will print the string in str from position 7 to 12 */ | |
System.out.println("substring is :- " + str.substring(7, 12)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment