Trimming Whitespace and removing punctuationHi guys - I saw that recode columns could trim white space and remove punctuation. Is there a specific JSL script that does this together?
Trimming whitespace JSL is below:
Regex( :review_text, "\s", "", globalreplace )
Could you guys share JSL script for removing punctuation? Ideally, I would like to have the script do both: remove punctuation and trim whitespace. Is there a clever JSL script to do that.
Thanks!
Thanks,
Rishi
Re: Trimming Whitespace and removing punctuationSeems like you could do something like this (note I made a slight modification to your code so I could test things). However, are you sure you want to remove ALL whitespace? The code you provided and my code here currently does remove all spaces.
review_text = "Hi, this is my new review! Do you think it's useful? What a statement.";
Regex( review_text, "[\s\?\.,!']", "", globalreplace )