Adding tabs
Posted: Mon Jun 06, 2005 9:18 am
Hi,
I was wondering how I would insert a tab (\t) in before all newline characters (\n) except if the newline comes at the end of a string. Also I'd need to append a \t to the start of the string. For example:
Would become:
I thought about exploding the string, adding the tabs then gluing it back together but I thought there might be a simpler regex way of doing this.
I was wondering how I would insert a tab (\t) in before all newline characters (\n) except if the newline comes at the end of a string. Also I'd need to append a \t to the start of the string. For example:
Code: Select all
\t\tSome Text
\tMore text
\t\t\tAlso textCode: Select all
\t\t\tSome Text
\t\tMore text
\t\t\t\tAlso text