Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int indexToPlaceCharacterAt = 3; // 5 is a placeholder, this is the variable you'll actually update
- String character = "e"; // letter that we'll put in the string
- String testString = "-----";
- testString = testString.substring(0, indexToPlaceCharacterAt) + character + testString.substring(indexToPlaceCharacterAt + 1, testString.length());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement