Use of indexof () method of stringclass

class dollaramt
{
public static void main(String args[])
{
String s = “The price of office bag is $225”;
System.out.println(s.substring(s.indexOf(‘$’)));
}
}

 

Share

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.