StrOps::Indent( StrBuf &, const StrPtr & )
Make a copy of a string, with each line indented.
Virtual? |
No |
|
Class |
||
Arguments |
|
the output string |
|
the input string |
|
Returns |
|
Notes
This function reads the input string s
and copies it to the
output string o
, with each line indented with a single
tab.
Example
StrBuf s = StrBuf(); s.Set( "abc\ndef\nghi\n" ); StrBuf o = StrBuf(); StrOps::Indent( o, s ); printf( "Before:\n%s", s.Text() ); printf( "After:\n%s", o.Text() );
Executing the preceding code produces the following output:
Before: abc def ghi After: abc def ghi