How to remove empty spaces in arrayText

Hi,

What I’m trying to achieve:
Have a while loop that executes steps if the pdf page contains the text “Question & response”.

What I have done:
Assign extracted text into a arrayText and check if arrayText(1) contains the keyword I am looking for.

All the following doesn’t work:
arrayText(1).Contains(“Question & response”) ← resulted in False even when the page contains it
arrayText(1).toString.Contains(“Question & response”) ← resulted in False even when the page contains it
arrayText(1).Contains(“Question”) ← works but not when other pages contains similar keyword in arrayText(1), may workflow will fail.

So now I’m trying to remove all the spaces in arrayText(1) but it doesn’t work as well:
arrayText(1).Replace(" “, “”) ← I can still see the spaces in the result
arrayText(1).Replace(”\s", “”) ← I can still see the spaces in the result

I’m not sure how can I solve this, please advise. Thanks!

Hi,

Can you try the following expression?

System.Text.RegularExpressions.Regex.IsMatch(arrayText(1),"Question\s+&\s+response")

or can you share your string as a file?

Regards,

Hi Yoichi,

Thanks for helping! I tried but it did not work as well. However, I managed to find a workaround to find if the text exist:

arrayText(1).StartsWith(“Applicant”) AND arrayText(1).Contains(“address”)

1 Like

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