Removing only first character that appear multiple times in a string
![Aminmin](https://us.v-cdn.net/6038231/uploads/Dataiku/nAvatar1.png)
Aminmin
Dataiku DSS Core Designer, Registered Posts: 18 ✭✭✭✭
Hi there, I am trying to remove the FIRST apostrophe in a string. There are also data that has apostrophe in the middle of the string which i do not want to remove eg. in '1234 output should be 1234. In '12'34 the 2nd ' should remain, output should be 12'34. Using Prepare, Replace ' --> No value will also replace the ' that is not the first character. Pls advise what I should do. Thank you
Best Answer
-
Alexandru Dataiker, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 1,211 Dataiker
Hi @Aminmin
,If you use the existing Replace processor in the prepare recipe with a small modification e.g
Use Regular Expression matching mode and provide the correct regex: ^'
^ is simply the "start of string" in regex :
Let me know if this is what you were looking for.
Answers
-
Hi AlexT, greatly appreciate your kind reply. I believe this works for me. Thanks!!