How to check if a String contains ' this single quote?

I want to check if a string contains a single quote. May I know whats the syntax for writing this?
Please help me thanks!

@Penganimation, Hi, Both these below will work, Try it and let me know.

YourStringVariable.Contains(Chr(34))

Or

YourStringVariable.Contains(" "" ")

1 Like

thank you, to be more precise i want to check this string '1
i want to detect if the ’ exists or not

@Penganimation

YourStringVariable.Contains(Chr(39))

    Or

YourStringVariable.Contains(" ' ")

it seems that when i have β€œ β€˜1 ”, it doesn’t work. but when i add a space between the 2 characters like this β€œ β€˜ 1 ”, it works.! But i want to detect the first case not the second case.

uipath|498x500

oh i got it, i must remove the space in front and behind. So that the string is an exact match. it works now, thank you so much!

@Penganimation,

Even the first solution the chr(39)?

@Penganimation

You can try this

testString.ToString.Contains(chr(39))

Hope this works

Thanks

@Penganimation, dont forget to mark the solution, glad i could help

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