+ 1
How do you replace a char to another index on the same string?
for eg i have String="ori",and i want to print out "rio" removing the first char at index zero and puttin it to index two
4 ответов
+ 2
Does it always shift first character to the right?
The easiest way would probably be to create a new string, copy one char from original string, then copy substring from original string beginning at first character, up to the second last character.
Use of an array of character as temporary buffer could be an option too. There are numerous ways to approach this, including use of built-in data structures e.g. stack.
+ 2
Ipang and [BusyTheseDays] thankyou 👌
+ 1
Ipang can u show me with an example?
+ 1
This one does the trick by employing the `.substring()` method of `String` class
https://code.sololearn.com/c2y5da4h94c8/?ref=app