// Simply, create a new string with character replaced, because strings are immutable in java String myName = "domanokz"; String newName = myName.substring(0,4)+'x'+myName.substring(5);