Uppercase or Lowercase a specific character in a word “Java”
问题 I have look into most of questions but I couldn't find how to uppercase or lowercase specific character inside a word. Example: String name = "Robert" What if I would like to make "b" Uppercase and rest lowercase also how to make first letter Uppercase and rest lowercase? Like "john" >> Output >> "John"... I have toUppercase() and toLowercase() . They convert the whole text. Also I tried to include charAt but never worked with me. 回答1: You will need to take your string, take a substring of