Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
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 (3)
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