C# Corner
Tech
News
Videos
Forums
Trainings
Books
Events
More
Interviews
Jobs
Live
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Java - String Manipulation Concept
WhatsApp
Senthilvelan Sambamoorthy
Aug 20
2016
790
0
0
str1.rar
class
str1
{
public
static
void
main(String arg[])
{
String s1 =
"Hello World"
;
String s2 =
"hello"
;
String s3 =
"world"
;
String s4 =
"JAVA"
;
String s5 =
"programming"
;
String s6 =
"hello"
;
System.out.println(
"\nString : "
+s1);
System.out.println(
"\nLength : "
+s1.length());
System.out.println(
"\nConcatination : "
+s2.concat(s3));
System.out.println(
"\nSub String : "
+s1.substring(
6
));
System.out.println(
"\nSub String : "
+s1.substring(
3
,
8
));
System.out.println(
"\nEquals : "
+s2.equals(s3));
System.out.println(
"\nEquals : "
+s2.equals(s6));
System.out.println(
"\nUpper case : "
+s5.toUpperCase());
System.out.println(
"\nLower case : "
+s4.toLowerCase());
System.out.println(
"\nTrim : "
+s1.trim());
}
}
Java
String Manipulation Concept
Up Next
Java - String Manipulation Concept