2021-04-02 【Java】文字を置換(replace) Java 文字を置換する方法です。 文字を置換 //文字列データ String str = "AAABBB"; //Aの文字をBに置換 str.replace('A', 'B'); 実行結果