Expand my Community achievements bar.

SOLVED

logic issue in ACC

Avatar

Level 2

i am trying to replace (') in field which have value in text format and have special character as(')  need to replace it with space, while using replace function in Enrichment activity(editing formula using expression) e.x.Replace(@fa,'\'',"'") , its giving error as unterminated string , Do we have any other way to required . Thanks in Advance

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @ayushhtiwari 

 

You can use JavaScript code to replace your special characters.

var Name = 'Ak\'sha\'y';
logInfo("Old Name "+Name);
var newName = Name.replace(/'/g,' ');
logInfo(newName);

 

Regards

Akshay

View solution in original post

4 Replies

Avatar

Correct answer by
Community Advisor

Hi @ayushhtiwari 

 

You can use JavaScript code to replace your special characters.

var Name = 'Ak\'sha\'y';
logInfo("Old Name "+Name);
var newName = Name.replace(/'/g,' ');
logInfo(newName);

 

Regards

Akshay

Avatar

Level 2

Hi @AkshayAnand 

Thanks this worked , but just curious to know , can we do same by any other way using any Formula using expression available in tool?

Avatar

Level 2

Hi @vt0509 it's giving "unterminated string constant error"