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: 
GRomain
Contributor III
Contributor III

using StringUtils.countMatches

Hi everyone,

I have issues using StringUtils.countMatches in talend.

Here is what i do :

I have a variable with several status in a String

==> context.STAT = "10,20" for example

And when i try to use StringUtils.countMatches like that, it sends me an error message

==> StringUtils.countMatches(context.STAT, "20");

The message is :

The method countMatches(String, String) is undefined for the type StringUtils.

I tried to import StringUtils but it doesn't change a thing. Am i missing something?

My java version is 1.8

Labels (3)
2 Replies
MS5
Contributor III
Contributor III

Hello,

 

Maybe you can use StringHandling.COUNT("hello world!","world") instead of StringUtils methods.

 

Best regards,

gjeremy1617088143

Hi you'll have to import this library :

org.apache.commons.lang3.StringUtils

wich contain the folowing method countMatches(String,String).