YOUR AD GOES HERE

Java Tutorial 53 - The String Class 5/5 (Remastered)

Published 30, Mar 2020

Ken


Description:
Obtaining Substrings

String s1 = "Welcome to Java";

Method Description
substring(beginIndex) Returns this string’s substring that begins with the character at the specified beginIndex
and extends to the end of the string, as shown in Figure 4.2.
e.g.

s1.substring(11); // Java

substring(beginIndex,endIndex) Returns this string’s substring that begins at the specified beginIndex
and extends to the character at index endIndex – 1, as shown in Figure 4.2.
Note the character at endIndex is not part of the substring.
s1.substring(0,11); // Welcome to

Releted More Videos

You May Also Like

YOUR AD GOES HERE

YOUR AD GOES HERE