Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

replace character using regex

kunal16
Tera Expert

I have a string like Building\Floor\Space\

My requirement - I want to replace all '\' with ',' and then split the result like:

Building

Floor

Space

How this can be achieved?? Looks like ServiceNow does not recognize '\' as a regex.

Any lead will be appreciated. Thanks in advance!!

5 REPLIES 5

Try something like this.

var str = mystring.replace(/"/g, '\'');

Please mark my response as correct and helpful if it helped solved your question.
-Thanks