Display system string


Dave Burns
June 30, 2016 12:14 ANSWERED
We have a number of processes that rely on OCR to extract information from a software running in a citrix screen, this works well when you can identify what is actually being scraped, example: document might be scraped as DOcument

I usually put a message box in the process to display what is being scraped but I have a variable which is type system.string[], how do I convert this to a text string so I can display it.



Andrzej.Kniola June 30, 2016 14:05
Hi Dave,

You can use the .Join method on the array (it will convert the whole array into a string with a given separator between them).

Or, you could iterate with a foreach loop and join them manually, f.e. putting a Environment.NewLine every so often.



Dave Burns June 30, 2016 14:43
Thanks for the reply, I have the OCR pass the context to a variable text and then separate the lines with

Text.Split({VbCr, VbLf, VbCrLf}, StringSplitOptions.RemoveEmptyEntries)

to line

Then do a for each line loop

line.Split({" "c}, StringSplitOptions.RemoveEmptyEntries)

to words1

It is the string value of words1 which is a type system.string[] that I am trying to identify.



Mihai Badita July 02, 2016 20:49
In this case words1(0) will contain the first string.


for (i=0, i < words1.GetLength(0), i++)

 writeline words(i)