I have the following numbers as shown below:
1234567890
I would like to get the result as:
1
2
3
4
5
6
7
8
9
0
(Horizontal to Vertical). Please help me to achieve it via simple regex or through editplus.
Thanks in advance !!!
You don't need a regular expression for this; all you're trying to accomplish is to insert a newline character between each element in your string.
If you're using C#, you can use the following:
string s = "1234567890";
string.Join(Environment.NewLine, s.ToCharArray());
Note that if your number is of a numeric data type (e.g., int
), you'll likely need to convert it to a string. In C#, this is as simple as calling the .ToString()
method, for example:
int x = 1234567890;
string s = x.ToString();
sorry I don't have editplus, but this should work (tested in notepad++)
Find:
([0-9])
replace:
\1\r\n
make sure to have regular expression search on (this may only pertain to notepad++)
the () creates a regular expression group, that may then be back referenced via the "\1" (see the link for a primer) the "\r\n" are just CRLF