How to split text by newline code “/n” ?
Hi @chenghai0208,
Split string activity can be used to split.
Separator as System.environment.newline
Thansk @SaranyaKishore
It works when the newline code is “\r\n”
But not work in the text use newline code “\n”
Hi @chenghai0208,
Use anyone of them as a delimeter
vbCrLf
- when you have both carriage return(Cr) and Line feed(Lf) in the string
vbCr
- Only when Carriage return(Cr) in the string
vbLf
- Only when Line feed(Lf) in the string
Reference : vb Constants
Thanks @Dominic
I don`t konw how to use them in uipath
↓↓↓ It don`t work
text.Split({“vbCrLf”},StringSplitOptions.none)
Hi @chenghai0208,
text.Split(Environment.NewLine.ToArray,StringSplitOptions.RemoveEmptyEntries)
Syntax for Split,
InputStringVariable.Split("delimeter"c)
OR
InputStringVariable.Split({delimeter1,delimeter2},StringSplitOptions.RemoveEmptyEntries)
Snippet:
str.Split(CChar(vblf))
OR
str.Split({vbLf},StringSplitOptions.RemoveEmptyEntries)
Where CChar
- Explicit Conversion from string to Char datatype.
Hi @chenghai0208 - Could you please upload the sample yaml file for reference.I tried the options mentioned, but receiving error.
thank you. Just what I needed