Say I had String s = "This is a loooooooooooooooong string";. Now say I want to cut off This and return everything else. How would I do this? What I’m asking is, is there a method that returns everything after x characters?
Say I had String s = This is a loooooooooooooooong string; . Now say
Share
Yes there is. And that method is the
substring()method, which takes an integer as its argument and slices off everything before the specified character position.Output: