In order to find whether a given string starts with a particular string or not in JAVA, use the following code.

public class Main {

  public static void main(String[] args) {

    String urStr = "Coderz Heaven";

    if (urStr.startsWith("Coderz")) {

      System.out.println("Yes! Your string starts with Coderz");


    else {






Leave a Reply

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




Theme by HermesThemes

Copyright © 2018 CoderzHeaven. All Rights Reserved

Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.