Skip to main content
Known Participant
May 25, 2015
Answered

How to Replace "Right Indent Tab" character?

  • May 25, 2015
  • 1 reply
  • 528 views

Hi All,

I want to replace "Tab" and "Right Indent Tab" to "<TAB>" text. "Tab" replace is working fine. How to replace "Right Indent Tab"? Below is my Code.

var myParaContents=app.selection[0].paragraphs[0].contents;

myParaContents=myParaContents.replace("\t","<TAB>");     //This code replace "\t" to "<TAB>". Like this I want to change Right Indent Tab character.

alert(myParaContents);

Thanks & Regards,

Senthilvel S

This topic has been closed for replies.
Correct answer Sajeev Sridharan

Try this,

var myParaContents=app.selection[0].paragraphs[0].contents;

myParaContents = myParaContents.replace(/\u0008/g, "<TAB>");

alert(myParaContents);

1 reply

Sajeev SridharanCorrect answer
Legend
May 25, 2015

Try this,

var myParaContents=app.selection[0].paragraphs[0].contents;

myParaContents = myParaContents.replace(/\u0008/g, "<TAB>");

alert(myParaContents);

Known Participant
May 25, 2015

Thanks Sajeev.

Code is working fine.