Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Sbxr80
Contributor
Contributor

How to replace number attached to hyphen with empty string.

@Shicong Hong

below is the input string :

1234-test1- test-jbddn-4856- string-test

result expectation:

test1- test-jbddn- string-test

so any string which is having number along with hyphen(5654-) it should replace with empty string ("").

Thanks in advance

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hello @Sushil Singh ,

You can try the below .replaceAll() method like

text.replaceAll("\\d{4}-", "");

 

Best regards

Aiming

View solution in original post

2 Replies
Anonymous
Not applicable

Hello @Sushil Singh ,

You can try the below .replaceAll() method like

text.replaceAll("\\d{4}-", "");

 

Best regards

Aiming

Sbxr80
Contributor
Contributor
Author

Thank you . this resolved my issue