Help Center

AfxStrReplacefunction

Replaces all the occurrences of a string with another string. Case sensitive.

String ManagementfunctionAfxStr.incdocumented

Syntax

FUNCTION AfxStrReplace (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 string.
wszMatchStrThe string expression to be replaced.
wszReplaceWithThe replacement string.

Description

Replaces all the occurrences of wszMatchStr in wszMainstr with the contents of wszReplaceWith. Case sensitive.

Example

DIM dws AS DWSTRING = AfxStrReplace("Hello World", "World", "Earth") ' Returns "Hello Earth"

Reference

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