Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
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
Creator III
Creator III

Hi you'll have to import this library :

org.apache.commons.lang3.StringUtils

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