Help Center

AfxStrReplaceAnyIfunction

Replaces all the occurrences of a group of characters with another character. Case insensitive.

String ManagementfunctionAfxStr.incdocumented

Syntax

FUNCTION AfxStrReplaceAnyI (BYREF wszMainStr AS CONST WSTRING, BYREF wszMatchStr AS CONST WSTRING, BYREF wszReplaceWith AS CONST WSTRING) AS DWSTRING

Parameters

NameDescription
wszMainStrThe main string from which you want to replace the specified characters.
wszMatchStrThe characters to be replaced.
wszReplaceWithThe replacement character.

Description

Replaces all the occurrences of any of the individual characters wszMatchStr in wszMainstr with the contents of wszReplaceWith. wszReplaceWith must be a single character (this function does not replace words; therefore, wszMatchStr will not shrink or grow). Case insensitive.

Example

DIM dws AS DWSTRING = AfxStrReplaceAnyI("abacadabra", "BaC", "") ' -> d**r*

Reference

  • Include file AfxStr.inc
  • Defined in AfxNova/AfxStr.inc:364
  • Documented in String Management/String Procedures.md
  • Topic: String Procedures