0

I am scanning my text and converting text to links. How do I replace the emoji chars from the link

for example pic.twitter.com/OIWBW3lnYBnY

I want to replace it with pic.twitter.com/OIWBW3lnYBnY Note the space after the character

Any ideas?

Neil
  • 2,802
  • 8
  • 34
  • 49

1 Answers1

-1
window.onload = function() {


//this is the code
var x='pic.twitter.com/OIWBW3lnYBnY';
//and this
var emoji_chars='-- ';
var y=x.replace(x.substring(0,4),emoji_chars);
// or (0,4) change (0,2)

//example
    document.body.innerHTML=y;
};
alessandrio
  • 4,282
  • 2
  • 29
  • 40