T
Trev
Hi everyone,
I'm having some problems using Regex; I have a long string that is
delimetered in a random fashion by a combination of spaces and \n's for
newlines. I have five possiblities:
// Character can be a-zA-Z0-9 plus any non-alphanumeric character (. ,
\ [ ] etc.)
// five possibilities:
// 1: Characters \nCharacters -> Characters Characters
// 2: Characters\n Characters -> Characters Characters
// 3: Characters \nCharacters -> Characters Characters
// 4: Characters \n Characters -> Characters Characters
// 5: Characters\nCharacters -> Characters Characters
So that a string like
A B \nC D\n E\nF \n G\nH
becomes
A B C D E F G H
Would regex be the "right" method to use, or some of the C# String
methods, like replace(...)?
If the former, could someone give me some helpful advice? It looks,
like for case 1, the regex
string would be something like .*\s\n.* but in this case, isn't \n
regarded as whitespace, like \s ?
TIA
Trev
I'm having some problems using Regex; I have a long string that is
delimetered in a random fashion by a combination of spaces and \n's for
newlines. I have five possiblities:
// Character can be a-zA-Z0-9 plus any non-alphanumeric character (. ,
\ [ ] etc.)
// five possibilities:
// 1: Characters \nCharacters -> Characters Characters
// 2: Characters\n Characters -> Characters Characters
// 3: Characters \nCharacters -> Characters Characters
// 4: Characters \n Characters -> Characters Characters
// 5: Characters\nCharacters -> Characters Characters
So that a string like
A B \nC D\n E\nF \n G\nH
becomes
A B C D E F G H
Would regex be the "right" method to use, or some of the C# String
methods, like replace(...)?
If the former, could someone give me some helpful advice? It looks,
like for case 1, the regex
string would be something like .*\s\n.* but in this case, isn't \n
regarded as whitespace, like \s ?
TIA
Trev