diff options
Diffstat (limited to '')
-rw-r--r-- | src/fstring.h | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/fstring.h b/src/fstring.h index 9de6a56..0306aa1 100644 --- a/src/fstring.h +++ b/src/fstring.h | |||
@@ -605,10 +605,26 @@ namespace Bu | |||
605 | 605 | ||
606 | /** | 606 | /** |
607 | * Find the index of the first occurrance of (sText) | 607 | * Find the index of the first occurrance of (sText) |
608 | *@param sText (const char *) The string to search for. | 608 | *@param sText (const chr *) The string to search for. |
609 | *@returns (long) The index of the first occurrance. -1 for not found. | 609 | *@returns (long) The index of the first occurrance. -1 for not found. |
610 | */ | 610 | */ |
611 | long find( const char *sText ) | 611 | long find( const chr cChar ) |
612 | { | ||
613 | flatten(); | ||
614 | for( long j = 0; j < pFirst->nLength; j++ ) | ||
615 | { | ||
616 | if( pFirst->pData[j] == cChar ) | ||
617 | return j; | ||
618 | } | ||
619 | return -1; | ||
620 | } | ||
621 | |||
622 | /** | ||
623 | * Find the index of the first occurrance of cChar | ||
624 | *@param cChar (const chr) The character to search for. | ||
625 | *@returns (long) The index of the first occurrance. -1 for not found. | ||
626 | */ | ||
627 | long find( const chr *sText ) | ||
612 | { | 628 | { |
613 | long nTLen = strlen( sText ); | 629 | long nTLen = strlen( sText ); |
614 | flatten(); | 630 | flatten(); |
@@ -622,10 +638,10 @@ namespace Bu | |||
622 | 638 | ||
623 | /** | 639 | /** |
624 | * Do a reverse search for (sText) | 640 | * Do a reverse search for (sText) |
625 | *@param sText (const char *) The string to search for. | 641 | *@param sText (const chr *) The string to search for. |
626 | *@returns (long) The index of the last occurrance. -1 for not found. | 642 | *@returns (long) The index of the last occurrance. -1 for not found. |
627 | */ | 643 | */ |
628 | long rfind( const char *sText ) | 644 | long rfind( const chr *sText ) |
629 | { | 645 | { |
630 | long nTLen = strlen( sText ); | 646 | long nTLen = strlen( sText ); |
631 | flatten(); | 647 | flatten(); |