WEB DEVELOPER SITE
PHP7
 

Java String substring() Method



Returns a new string that is a substring of this string.


Syntax

Here is the syntax of this method โˆ’

public String substring(int beginIndex)

Parameters

Here is the detail of parameters โˆ’

  • beginIndex โˆ’ the begin index, inclusive.

Return Value

  • The specified substring.

Example

import java.io.*;
public class Test {

   public static void main(String args[]) {
      String Str = new String("Welcome to Welookups.com");

      System.out.print("Return Value :" );
      System.out.println(Str.substring(10) );

   }
}
Run example ยป