How to replace part of string by position?

后端 未结 18 890
逝去的感伤
逝去的感伤 2020-11-28 04:37

I have this string: ABCDEFGHIJ

I need to replace from position 4 to position 5 with the string ZX

It will look like this: ABC

18条回答
  •  萌比男神i
    2020-11-28 05:31

    All others answers don't work if the string contains Unicode char (like Emojis) because an Unicode char weight more bytes than a char.

    Example : the emoji '

提交回复
热议问题