libStrings (String Processing Functions)

This file containts functions to deal with strings in VBA.

Summary
This file containts functions to deal with strings in VBA.
The error number used for errors raised by the functions in this library.
Replaces the first occurence of replacee within target with replacer and returns the resulting string.
Returns the number that results, if all numeric characters in s are concatenated.
Returns the number of digits within s.
Increments the last number found in s by increment.

Constants

STRING_ERROR_NUMBER

The error number used for errors raised by the functions in this library.

Functions

replaceInString(target As String, replacee As String, replacer As String) As String

Public Function replaceInString(target As String,
replacee As String,
replacer As String) As String

Replaces the first occurence of replacee within target with replacer and returns the resulting string.

result = replaceInString("monkey", "ke", "etar")

getNumberFromString(s As String) As Integer

Public Function getNumberFromString(As String) As Integer

Returns the number that results, if all numeric characters in s are concatenated.

r = getNumberFromString("H12B24")

countDigitsInString(s As String) As Integer

Public Function countDigitsInString(As String) As Integer

Returns the number of digits within s.

n = countDigitsInString("H12B24")

incrementLastNumberInString(s As String, increment As Integer) As String

Public Function incrementLastNumberInString(As String,
increment As Integer) As String

Increments the last number found in s by increment.

r = incrementLastNumberInString("H12B24", 2)
Public Function replaceInString(target As String,
replacee As String,
replacer As String) As String
Replaces the first occurence of replacee within target with replacer and returns the resulting string.
Public Function getNumberFromString(As String) As Integer
Returns the number that results, if all numeric characters in s are concatenated.
Public Function countDigitsInString(As String) As Integer
Returns the number of digits within s.
Public Function incrementLastNumberInString(As String,
increment As Integer) As String
Increments the last number found in s by increment.