Advertisement
Guest User

Untitled

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