ReplaceAllB Function

Replaces all occurrences of a String with another String.

Syntax
result = ReplaceAllB( sourceString, oldString, newString )
result = stringVariable.ReplaceAllB( oldString, newString )

Parameters
sourceString | String | The original string.
oldString | String | The characters to be replaced.
newString | String | The replacement characters.

Return Value
Result | String | A copy of sourceString with any changes made by the ReplaceAll function.

# Notes

The ReplaceAllB function replaces all occurrences of oldString in sourceString with newString. ReplaceAllB is case-sensitive because it treats the source string as a series of raw bytes.

If newString is an empty string (""), the ReplaceAllB function deletes every occurrence of the oldString in the sourceString.

If oldString is an empty string (""), the ReplaceAllB function returns an unchanged copy of the sourceString.

ReplaceAllB is case-sensitive; it treats sourceString as a series of raw bytes. It should be used instead of ReplaceAll when the string represents binary data or when your application will run in a one-byte character set (such as the US system) and you want case-sensitivity.

# Examples

Below are some examples that show the results of the ReplaceAll function

Dim result As String
result=ReplaceAllB("xyxyxy","x","z") //returns "zyzyzy"
result=ReplaceAllB("The quick fox"," ","") //returns "Thequickfox"

:

# See Also

Replace, ReplaceB, ReplaceAll, ReplaceLineEndingsfunctions.