Changeset 421 for trunk/src/cppbase/bs_string.cpp
- Timestamp:
- Feb 2, 2015, 2:11:18 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/cppbase/bs_string.cpp
r254 r421 8 8 9 9 /* 10 * This file Copyright (C) 1999-20 01Ulrich Mller.10 * This file Copyright (C) 1999-2015 Ulrich Mller. 11 11 * This program is free software; you can redistribute it and/or modify 12 12 * it under the terms of the GNU General Public License as published by … … 579 579 } 580 580 581 return (npos); 582 } 583 584 /* 585 *@@ find_first_of: 586 * finds the first character in the member 587 * string which is the same as "c". 588 * 589 * The search is started at ulPos, which 590 * defaults to 0. 591 * 592 * Returns BSString::npos if not found. 593 * 594 *@@added V1.0.21 (2015-01-29) [pr] 595 */ 596 597 size_type BSString::find_first_of(char c, // in: character to find 598 size_type ulPos) // in: start of search (defaults to 0) 599 const 600 { 601 STRINGLOCK; 602 size_type Size = size(); 603 604 if ( (ulPos < Size) 605 && (c) 606 ) 607 { 608 char *p; 609 size_type ul; 610 for (p = _pBuf->_str.psz + ulPos, ul = ulPos; 611 ul < Size; 612 ++p, ++ul) 613 { 614 if (*p != c) 615 return (ul); 616 } 617 } 618 619 // not found: 581 620 return (npos); 582 621 }
Note:
See TracChangeset
for help on using the changeset viewer.