Stringの文字列から一部を取り出すためには、substringメソッドを使用します。 String test = 'abcdefghijklmnopqrstuvwxyz'; print (test.substring (2, 6)); // cdef 第一引数は開始位置、第二引数は終了位置を指定する情報で、最初の文字の前を0として、2文字目の前を1、3文字目の前を2というように数えていきます ...
pos = starting position of the sub-string to be replaced. len = length of the substring new_string = the string that will replace the substring Second implementation: string.replace(pos, old_string, ...