string.startsWith()

String.startsWith() Checks the string whether it starts with input string or not.
Syntax
String1.startsWith(String2)
Return value is boolean ( true or false )

Here are some examples with output.
String my_str="plus2net";
		 
System.out.println(my_str.startsWith("plus"));  // true
System.out.println(my_str.startsWith("pl"));  // true
System.out.println(my_str.startsWith("p"));  // true
System.out.println(my_str.startsWith("plus2net"));  // true
System.out.println(my_str.startsWith("PLUS"));  // false
System.out.println(my_str.startsWith("net"));  // false
System.out.println(my_str.startsWith("et"));  // false
This is case sensitive matching of end part of the string.

All String functions

Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com



    Post your comments , suggestion , error , requirements etc here




    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2022 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer