I have an input string as follows:
thumb_634735515600845357tchayat_november_200612.jpg
What I want to do is first split this string by _
. And then take the resulting tokens at positions 1 to n and join them.
Specifically, with respect to my sample input, here is my desired output. As you can see, thumb_
has been removed from the front of the string:
634735515600845357tchayat_november_200612.jpg
I know how to do the split. But then how do I do the join step that follows? I do realize that I can use a for
loop to do the join. But is there a better way? I can't use a sub-string approach to do the join step because I have data before thumb_
.
Finally, note that the _
character that follows thumb
is always the first instance of _
.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…