Skip to main content
solution for emojis
Source Link
colllin
  • 9.8k
  • 10
  • 53
  • 66
str = str.split('');
str[3] = 'h';
str = str.join('');

From @konrad:

[...str] can be used instead of str.split('') to make it work with emojis

str = [...str]
str[3] = 'h'
str = str.join('')
str = str.split('');
str[3] = 'h';
str = str.join('');
str = str.split('');
str[3] = 'h';
str = str.join('');

From @konrad:

[...str] can be used instead of str.split('') to make it work with emojis

str = [...str]
str[3] = 'h'
str = str.join('')
Source Link
colllin
  • 9.8k
  • 10
  • 53
  • 66

str = str.split('');
str[3] = 'h';
str = str.join('');