Helix Core is now P4. Product user interfaces will be updated soon. Learn more >>

C/C++ API Documentation | 2025.2

# StrOps::Indent( StrBuf &, const StrPtr & )

Make a copy of a string, with each line indented.

Virtual? | No |
Class | `StrOps` |
Arguments | `StrBuf &o` | the output string
| `StrPtr &s` | the input string
Returns | `void` |

## 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

Copy

    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

Your search for returned results