|
-
August 18th, 2017, 11:08 PM
#3
Re: Searching char in String
public class Matching
{
public static void main(String args[])
{
String str = "pqrpqrpqr";
System.out.println(str.indexOf('r'));
System.out.println(str.indexOf("qrp"));
System.out.println(str.indexOf('u'));
System.out.println(str.lastIndexOf('p'));
System.out.println(str.charAt(3));
System.out.println(str.length());
System.out.println(str.charAt(12));
}
}
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|