java substring one parameter
"Chaitanya".substring(2)//=>aitanya
//make me a SubString starting from index 2 to the end of the string!
java substring one parameter
"Chaitanya".substring(2)//=>aitanya
//make me a SubString starting from index 2 to the end of the string!
java substring
String s = "Let's Get This Bread";
String subString = s.substring(6, 9);
// (start index inclusive, end index exclusive)
// subString == "Get"
how to do substring java
class Main {
public static void main (String[] args) {
String str = "Hello World!";
String firstWord = str.substring(0, 5);
//two parameters are start and end index: (inclusive, non-inclusive)
String secondWord = str.substring(6, 11);
//firstWord has string "Hello"
//secondWord has string "World"
}
}
how to substring in java
class scratch{
public static void main(String[] args) {
String hey = "Hello World";
System.out.println( hey.substring(0, 5) );
// prints Hello;
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us