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(" "" ")

1 Like

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




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.


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!


Even the first solution the chr(39)?


You can try this


Hope this works


@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.