Function CSPString::Replace()

Description:
Replaces the occurences of a substring in a string with another substring. The number of maximum first occurences to be replaced can be optionally specified.

Prototype:
unsigned long Replace(const CSPString& strFind, const CSPString& strReplace, unsigned long ulFirst = 0);

Arguments:
  • const CSPString& strFind [IN]
    The substring to find.

  • const CSPString& strReplace [IN]
    The substring to replace with.

  • unsigned long ulFirst = 0 [IN]
    The maximum number of first occurences to replace.



Return value:
The number of substring occurences replaced.

Remarks:
If ulFirst is 0, all the substring occurences are replaced.

Examples:
CSPString strText = "1 plus 34 plus 12";
strText.Replace( "plus", "+" );

See also:
member function Find()
CSPString | Basic classes | Class Categories | Online help home | Back

www.micronovae.com

Copyright © 2002 - 2005 Micronovae Ltd