Örneğin ben, ikinci son virgül bir dize kırmak için bir yol bulmaya çalışıyorum:
piece 1, piece 2, piece 3, piece 4, piece 5, piece 6, piece 7
2 parça olmalıdır:
piece 1, piece 2, piece 3, piece 4, piece 5
ve
piece 6, piece 7
ve
piece 1, piece 2, piece 3, piece 4, piece 5
olmalıdır:
piece 1, piece 2, piece 3
ve
piece 4, piece 5
Is there a string manipulation to search the string for a character veidentify the position of the second last instance of that character?
I thought about exploding the string by ,
then gluing the last 2 to make part 2, vegluing however many first ones (varies) to make part 1, but I think that might be overkill. Any string manipulations for this?