From d6986e5d77917cbfd1b5fab86d79c6abbd9b4aac Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 21 Dec 2009 22:24:08 +0000 Subject: Added a trimBack fonction to FBasicString that removes all occurances of once char from the back of the string. --- src/fbasicstring.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/fbasicstring.h') diff --git a/src/fbasicstring.h b/src/fbasicstring.h index 5271b62..c885cbb 100644 --- a/src/fbasicstring.h +++ b/src/fbasicstring.h @@ -1859,6 +1859,14 @@ namespace Bu core->appendChunk( pNew ); } + void trimBack( chr c ) + { + if( core->pFirst == NULL ) + return; + flatten(); + for( ; core->pFirst->nLength > 0 && core->pFirst->pData[core->pFirst->nLength-1] == c; core->pFirst->nLength--, core->nLength-- ) { } + } + void format( const char *sFrmt, ...) { _hardCopy(); -- cgit v1.2.3