diff options
| author | xo <boneyaard@gmail.com> | 2026-04-13 01:46:46 +0200 |
|---|---|---|
| committer | xo <boneyaard@gmail.com> | 2026-04-13 01:46:46 +0200 |
| commit | e827fd28abfacee5784b5a86548ebd668c84a070 (patch) | |
| tree | 8c8aeaba9edbf5b8df8ebe42df0ca11f9ce772d1 /src/util | |
| parent | 8099c2a11fb4010542973bf85359935da19e2192 (diff) | |
Diffstat (limited to 'src/util')
| -rw-r--r-- | src/util/string.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/util/string.h b/src/util/string.h index 2725fd2..548007a 100644 --- a/src/util/string.h +++ b/src/util/string.h @@ -277,6 +277,13 @@ struct __str : public LIST<CT> { return ret; } + __str<CT> substr( I32 start ) { + if( start < 0 ) + start = this->size + start; + + return __str<CT>( this->size - start, this->data + start ); + } + // can take negative input as offset from end __str<CT> substr( I32 start, I32 end ) { if( start < 0 ) |
