AfxStrRemovefunction
Returns a new string with substrings removed. Case sensitive.
Syntax
FUNCTION AfxStrRemove (BYREF wszMainStr AS CONST WSTRING, BYREF wszMatchStr AS CONST WSTRING) AS DWSTRING
FUNCTION AfxStrRemove (BYREF wszMainStr AS CONST WSTRING, BYREF wszDelim1 AS CONST WSTRING, BYREF wszDelim2 AS CONST WSTRING, BYVAL fRemoveAll AS BOOLEAN = FALSE) AS DWSTRING
FUNCTION AfxStrRemove (BYVAL nStart AS LONG = 1, BYREF wszMainStr AS CONST WSTRING, BYREF wszDelim1 AS CONST WSTRING, BYREF wszDelim2 AS CONST WSTRING, BYVAL fRemoveAll AS BOOLEAN = FALSE) AS DWSTRING
Parameters
| Name | Description | |
|---|---|---|
wszMainStr | The main string. | |
wszMatchStr | The string expression to be removed. If wszMatchStr is not present in wszMainStr, all of wszMainStr is returned intact. | |
wszMainStr | The main string. | |
wszDelim1 | The first delimiter | |
wszDelim2 | The second delimiter | |
fRemoveAll | Recursively remove all the occurrences. | |
nStart | Optional. The one-based starting position where to start the search. | |
wszMainStr | The main string. | |
wszDelim1 | The first delimiter | |
wszDelim2 | The second delimiter | |
fRemoveAll | Recursively remove all the occurrences. |
Description
Returns a new string with strings removed. Case sensitive.
Examples
DIM dws AS DWSTRING = AfxStrRemove("Hello World. Welcome to the Freebasic World", "World")
DIM dwsText AS DWSTRING = "blah blah (text between parentheses) blah blah" DIM dws AS DWSTRING = AfxStrRemove(dwsText, "(", ")") ' Returns "blah blah blah blah"
DIM dwsText AS DWSTRING = "As Long var1(34), var2( 73 ), var3(any)" DIM dws AS DWSTRING = AfxStrRemove(dwsText, "(", ")", TRUE) ' Returns "As Long var1, var2, var3"
DIM dwsText AS DWSTRING = "blah blah (text beween parentheses) blah blah" DIM dws AS DWSTRING = AfxStrRemove(dwsText, "(", ")") ' Returns "blah blah blah blah"
Reference
- Include file
AfxStr.inc - Defined in AfxNova/AfxStr.inc:186
- Documented in String Management/String Procedures.md
- Topic: String Procedures