Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (3.9k points)

In Java, I have a String:

Jamaica

I would like to remove the first character of the string and then return amaica

How would I do this?

1 Answer

0 votes
by (46k points)

Use the substring() capacity with an argument of 1 to prepare the substring from position 1 (after the first part) to the end of the string (leaving the second argument from defaults to the full length of the string).

"Jamaica".substring(1);

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...