Home > Software engineering >  Split a string with Backslash
Split a string with Backslash

Time:06-23

I'm trying to split a long string with a lot of data in it. The data come with a separator character '\r', I wanted to place each row into a List<> and carry out a string.split(). When I use the backslash as separator this doesn't work. I have read the below thread but it doesn't help me cause it still won't separate the data into rows. The idea was to crate a list and place later all info in a datagridview. Therefore I need to split all separate information

enter image description here

And here the result when I try to split the string

enter image description here

Am I making somewhere a silly mistake or is my strategy completely wrong?

CodePudding user response:

Adopted from this answer: enter image description here

  • Related