Get OCR Text containing caracter "


#1

Hello,

I would like to compare the result of an OCR, but the text contain the caracters "

So, i’m not able to make any OCRText = "my text with "this" in it"

Is there any special caracter to deal with " as a string and not a text identifier ?


#2

Hi @CG00,
Have you tried to replace the " character to “”"?
In this case, I believe that UIPath will recognize it as a string.


#3

Hello,

Using “”" is not solving the problem, the text """MY_TEXT""" is recognized as variable and not text


#4

I was also thinking about regex to delete the ", but i still can’t use " because UI Path is waiting for the second "


#5

As you can see, it was able to have the " character with the variable that I have created.

In this case, I’m assigning the value "Hello ““My Friend”” " to my variable and I’m also replacing those double quotations marks using the Replace method.

If possible please provide your xaml solution, so we may assist you better. I’ve uploaded my example.
Main.xaml (5.6 KB)


#6

You’re right ! :slight_smile:

I was trying to remove all " and not ""

edit : good luck to remove only 1 " ?


#7

@CG00 If you want, you may also remove a specific character or a set of characters from any position using the .Remove method as you can see below:

Also, the following Regex remove the first occurrence of the double quotation mark:
Regex.Replace(msg, “(?<=^[^”"])""|""(?=[^""]$)"", “”""""""", “”)