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

C/C++ API Documentation | 2025.1

# StrRef::operator +=( int )

Increase a `StrRef’s` pointer and decrease its length.

Virtual? | No |
Class | `StrRef` |
Arguments | `int len` | the amount by which to move the pointer
Returns | `void` |

## Notes

This method has the effect of removing `len` characters from the beginning of the `StrRef`. It does not, however, free the memory allocated to those characters.

## Example

Copy

    #include &lt;iostream&gt;

    #include &lt;stdhdrs.h&gt;
    #include &lt;strbuf.h&gt;

    int main( int argc, char **argv )
    {
        char chars[] = "xyzzy";
        StrRef sr = StrRef( chars );

        sr += 3;

        cout &lt;&lt; "chars[] = \"" &lt;&lt; chars &lt;&lt; "\"\n";
        cout &lt;&lt; "sr.Text() returns \"" &lt;&lt; sr.Text() &lt;&lt; "\"\n";
    }

Executing the preceding code produces the following output:

    chars[] = "xyzzy"
    sr.Text() returns "zy"

Your search for returned results