There's one problem with that code: the string will have 11 (16 - 5) null-characters ('\0') at its end. There is a quick fix: use the other String constructor that takes a char. Hint: you already have the count as one of your variables.
Joined: Nov 09, 2008
Sorry, I didn't quite get you. Alternatively, could I trim it?
we can also use split function to achieve it ...moreover the inddex 4 means in the question as the second word......in that case we can split the string with " " as the parameter , and then the second word will do.....