String.contains not working

Hi experts,
I am facing really strange issue, I am getting text from one element which having 7000 length when I try to check if that string variable contains any particular string it always showing false.

Please help close to release .

Hi @amruta_pawar !
So we understand the issue, would you mind sharing with us the string of 7000 length + the string you’re looking for inside ?

Due to security constraint i am not able to share but it just names of users separated by new line and in that i need to search new added user.

Alright, then what about you create a dummy data and check if it recognizes the string you’re looking for ? Or what about you anonimyze the data and send it to us ?
Unfortunately, without data we cannot understand why it’s not working :confused:
Did you check if the string you’re looking for is exactly the same ? Like casesensitive

Yes string is exact same , ok i will replicate it with other names and will share

Also, maybe you can share exactly the comand you used.
Maybe you have spaces there, you might need to use .Trim().

It resolved by removing spaces from string thank you all for guidance.

That’s great to hear !
Don’t forget to mark your topic as solved :grinning_face_with_smiling_eyes:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.