Can anyone tell me how to get a part of string which is divided by chr 10?

Hello everyone, I am a rookie to use the Uipath studio. The question is as same as the title, to be more precise, I am trying to make an example:
I get a string from somewhere, and copied them into a cell of excel, and this string has how many rows(but within one cell of excel), and I just wanna get the second row content, all the rest need to be erased.
Can anyone could help me?
The following is an example, there are sentences which are divided by alt+Enter, after the operation, I wanna only “Sono 12# anni adesso! With me” on cell C2. By the way, every time the input content may be different…
I am trying to recognize element.newline, but finally failed, please anyone could help me, thank you in advance!

You could split the string using “!” In the shown case here and get the 2nd part of string

Hi @Baggio

Try this regex pattern

Screenshot_20210201_004121

Regards

NIVED N :robot:

Happy Automation :relaxed::relaxed::relaxed:

Thanks for your reply!
But every time the text may different, may exclude “!”, I am considering to recognize “chr 10”, but didn’t succeed…

Thanks for your reply!
I am going to try it, but I am not sure I can understand what you typed…
If ”regex pattern” is an activity?

Hi,

There are some ways to achieve it.

Spit method

yourString.Split(Chr(10))(1)

Regex (as @NIVED_NAMBIAR mentioned)

System.Text.RegularExpressions.Regex.Match(yourString,"(?<=\n).*").Value

Regards,

1 Like