Question Detail

How to use Substring in java ?

6 years ago Views 1477 Visit Post Reply

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?

Thread Reply

Bili Greed

- 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";



- 6 years ago

public class TestSubstring{  

 public static void main(String args[]){  

   String s="SachinTendulkar";