I have a String "This is my String Cut it."
i want to cut this String and show only "This is my String"
how can I do it in java or android?
- 6 years ago
In java substring is a function which will cut given String as you want just enter your requirement.
Try below syntax :
String str= "Here Your String";
System.out.println(str.substring(5,16));
- 6 years ago
public class TestSubstring{
public static void main(String args[]){
String s="SachinTendulkar";
System.out.println(s.substring(6));//Tendulkar
System.out.println(s.substring(0,6));//Sachin
}
}
Hot Questions