Interface IStdStringsModule
MS-VBAL 6.1.2.11 Strings Module
[StdLibModule(null)]
public interface IStdStringsModule
Remarks
Formalizes the public interface of the standard library VBA.Strings module.
Three families of member recur here, and the declarations are shaped to keep them apart. A
$-suffixed function is a member of its own, identical to the unsuffixed one but returning
String rather than Variant; the two differ in nothing else, so C# cannot overload them
and each states its VBA name with StdLibMemberAttribute. A B-suffixed function
counts in bytes rather than in characters. And Compare As VbCompareMethod recurs
wherever a comparison happens - Filter, InStr, InStrB, InStrRev,
Replace, Split, StrComp - declared = vbBinaryCompare as the specification
declares it, and "if omitted, it uses the <option-compare-directive> of the calling module". Each
is marked with StdLibOptionCompareAttribute, so a call from source fills an omitted one
with the caller's mode, and the member always receives the comparison to make; a caller with no
calling module gets the declared vbBinaryCompare.
A typed optional whose specification declares a default C# cannot carry states it with
StdLibDefaultAttribute: InStrRev's Start, Replace's Start and
Count, Split's Limit, Filter's Include, the NumDigitsAfterDecimal of
FormatCurrency, FormatNumber and FormatPercent, and the Abbreviate of MonthName and
WeekdayName.
Methods
Asc(VBStringValue)
MS-VBAL 6.1.2.11.1.1 Asc Gets the character code of the first character of a string.
RuntimeSemanticsEvaluationResult<VBIntegerValue> Asc(VBStringValue @string)
Parameters
stringVBStringValueThe string whose first character to report the code of: the parameter
String, which a named argument names (Asc(String:="A")).
Returns
- RuntimeSemanticsEvaluationResult<VBIntegerValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
AscB(VBStringValue)
MS-VBAL 6.1.2.11.1.2 AscB Gets the value of the first byte of a string, rather than of its first character.
RuntimeSemanticsEvaluationResult<VBIntegerValue> AscB(VBStringValue @string)
Parameters
stringVBStringValueThe string whose first byte to report the value of: the parameter
String.
Returns
- RuntimeSemanticsEvaluationResult<VBIntegerValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
AscW(VBStringValue)
MS-VBAL 6.1.2.11.1.3 AscW Gets the Unicode code point of the first character of a string.
RuntimeSemanticsEvaluationResult<VBIntegerValue> AscW(VBStringValue @string)
Parameters
stringVBStringValueThe string whose first character to report the code point of: the parameter
String, which a named argument names (AscW(String:="Z"), MS-VBA, recorded in Excel: oracle\s46 F19).
Returns
- RuntimeSemanticsEvaluationResult<VBIntegerValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Chr(VBLongValue)
MS-VBAL 6.1.2.11.1.4 Chr Gets the character a character code names.
RuntimeSemanticsEvaluationResult<VBVariantValue> Chr(VBLongValue charCode)
Parameters
charCodeVBLongValueThe character code.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
ChrB(VBLongValue)
MS-VBAL 6.1.2.11.1.5 ChrB Gets a single-byte string holding the given value, rather than the character that value names.
RuntimeSemanticsEvaluationResult<VBVariantValue> ChrB(VBLongValue charCode)
Parameters
charCodeVBLongValueThe byte value.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
ChrBString(VBLongValue)
MS-VBAL 6.1.2.11.1.5 ChrB Gets a single-byte string holding the given value, rather than the character that value names.
[StdLibMember("ChrB$")]
RuntimeSemanticsEvaluationResult<VBStringValue> ChrBString(VBLongValue charCode)
Parameters
charCodeVBLongValueThe byte value.
Returns
- RuntimeSemanticsEvaluationResult<VBStringValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
ChrString(VBLongValue)
MS-VBAL 6.1.2.11.1.4 Chr Gets the character a character code names.
[StdLibMember("Chr$")]
RuntimeSemanticsEvaluationResult<VBStringValue> ChrString(VBLongValue charCode)
Parameters
charCodeVBLongValueThe character code.
Returns
- RuntimeSemanticsEvaluationResult<VBStringValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
ChrW(VBLongValue)
MS-VBAL 6.1.2.11.1.6 ChrW Gets the character a Unicode code point names.
RuntimeSemanticsEvaluationResult<VBVariantValue> ChrW(VBLongValue charCode)
Parameters
charCodeVBLongValueThe Unicode code point.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
ChrWString(VBLongValue)
MS-VBAL 6.1.2.11.1.6 ChrW Gets the character a Unicode code point names.
[StdLibMember("ChrW$")]
RuntimeSemanticsEvaluationResult<VBStringValue> ChrWString(VBLongValue charCode)
Parameters
charCodeVBLongValueThe Unicode code point.
Returns
- RuntimeSemanticsEvaluationResult<VBStringValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Filter(VBVariantValue, VBStringValue, VBBooleanValue?, VBCompareMethod)
MS-VBAL 6.1.2.11.1.7 Filter Gets a zero-based array of the elements of an array that match, or that do not match, a substring.
RuntimeSemanticsEvaluationResult<VBVariantValue> Filter(VBVariantValue sourceArray, VBStringValue match, VBBooleanValue? include = null, VBCompareMethod compare = VBCompareMethod.VBBinaryCompare)
Parameters
sourceArrayVBVariantValueThe one-dimensional array of strings to search.
matchVBStringValueThe substring to search for.
includeVBBooleanValueTrueto return the elements containingmatch,Falseto return the ones that do not.Truewhen omitted.compareVBCompareMethodThe string comparison to use. When omitted, the calling module's
Option Compare.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
👉 sourceArray is declared SourceArray() As Variant, and is a Variant here: an array parameter takes an
array of its own element type only, which would refuse the String() that Split returns, so the member checks for itself
that what it is given is a one-dimensional array.
Format(VBVariantValue, VBVariantValue?, VBDayOfWeek, VBFirstWeekOfYear)
MS-VBAL 6.1.2.11.1.8 Format Gets a string formatted according to a format expression.
RuntimeSemanticsEvaluationResult<VBVariantValue> Format(VBVariantValue expression, VBVariantValue? format = null, VBDayOfWeek firstDayOfWeek = VBDayOfWeek.VBSunday, VBFirstWeekOfYear firstWeekOfYear = VBFirstWeekOfYear.VBFirstJan1)
Parameters
expressionVBVariantValueAny valid expression.
formatVBVariantValueA valid named or user-defined format expression.
firstDayOfWeekVBDayOfWeekThe day the week starts on.
firstWeekOfYearVBFirstWeekOfYearThe week the year starts on.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
FormatCurrency(VBVariantValue, VBLongValue?, VBTriState, VBTriState, VBTriState)
MS-VBAL 6.1.2.11.1.10 FormatCurrency Gets a string formatted as a currency value, with the currency symbol of the environment's own regional settings.
RuntimeSemanticsEvaluationResult<VBStringValue> FormatCurrency(VBVariantValue expression, VBLongValue? numDigitsAfterDecimal = null, VBTriState includeLeadingDigit = VBTriState.VBUseDefault, VBTriState useParensForNegativeNumbers = VBTriState.VBUseDefault, VBTriState groupDigits = VBTriState.VBUseDefault)
Parameters
expressionVBVariantValueThe expression to format.
numDigitsAfterDecimalVBLongValueHow many places to the right of the decimal separator to show.
-1uses the environment's regional settings.includeLeadingDigitVBTriStateWhether a leading zero is shown for a fractional value.
useParensForNegativeNumbersVBTriStateWhether a negative value is parenthesized.
groupDigitsVBTriStateWhether digits are grouped with the environment's own group separator.
Returns
- RuntimeSemanticsEvaluationResult<VBStringValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
FormatDateTime(VBVariantValue, VBDateTimeFormat)
MS-VBAL 6.1.2.11.1.11 FormatDateTime Gets a string formatted as a date, a time, or both.
RuntimeSemanticsEvaluationResult<VBStringValue> FormatDateTime(VBVariantValue expression, VBDateTimeFormat namedFormat = VBDateTimeFormat.VBGeneralDate)
Parameters
expressionVBVariantValueThe date expression to format.
namedFormatVBDateTimeFormatWhich of the named date/time formats to use.
Returns
- RuntimeSemanticsEvaluationResult<VBStringValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
FormatNumber(VBVariantValue, VBLongValue?, VBTriState, VBTriState, VBTriState)
MS-VBAL 6.1.2.11.1.12 FormatNumber Gets a string formatted as a number.
RuntimeSemanticsEvaluationResult<VBStringValue> FormatNumber(VBVariantValue expression, VBLongValue? numDigitsAfterDecimal = null, VBTriState includeLeadingDigit = VBTriState.VBUseDefault, VBTriState useParensForNegativeNumbers = VBTriState.VBUseDefault, VBTriState groupDigits = VBTriState.VBUseDefault)
Parameters
expressionVBVariantValueThe expression to format.
numDigitsAfterDecimalVBLongValueHow many places to the right of the decimal separator to show.
-1uses the environment's regional settings.includeLeadingDigitVBTriStateWhether a leading zero is shown for a fractional value.
useParensForNegativeNumbersVBTriStateWhether a negative value is parenthesized.
groupDigitsVBTriStateWhether digits are grouped with the environment's own group separator.
Returns
- RuntimeSemanticsEvaluationResult<VBStringValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
FormatPercent(VBVariantValue, VBLongValue?, VBTriState, VBTriState, VBTriState)
MS-VBAL 6.1.2.11.1.13 FormatPercent Gets a string formatted as a percentage — the expression multiplied by 100, with a trailing %.
RuntimeSemanticsEvaluationResult<VBStringValue> FormatPercent(VBVariantValue expression, VBLongValue? numDigitsAfterDecimal = null, VBTriState includeLeadingDigit = VBTriState.VBUseDefault, VBTriState useParensForNegativeNumbers = VBTriState.VBUseDefault, VBTriState groupDigits = VBTriState.VBUseDefault)
Parameters
expressionVBVariantValueThe expression to format.
numDigitsAfterDecimalVBLongValueHow many places to the right of the decimal separator to show.
-1uses the environment's regional settings.includeLeadingDigitVBTriStateWhether a leading zero is shown for a fractional value.
useParensForNegativeNumbersVBTriStateWhether a negative value is parenthesized.
groupDigitsVBTriStateWhether digits are grouped with the environment's own group separator.
Returns
- RuntimeSemanticsEvaluationResult<VBStringValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
FormatString(VBVariantValue, VBVariantValue?, VBDayOfWeek, VBFirstWeekOfYear)
MS-VBAL 6.1.2.11.1.8 Format Gets a string formatted according to a format expression.
[StdLibMember("Format$")]
RuntimeSemanticsEvaluationResult<VBStringValue> FormatString(VBVariantValue expression, VBVariantValue? format = null, VBDayOfWeek firstDayOfWeek = VBDayOfWeek.VBSunday, VBFirstWeekOfYear firstWeekOfYear = VBFirstWeekOfYear.VBFirstJan1)
Parameters
expressionVBVariantValueAny valid expression.
formatVBVariantValueA valid named or user-defined format expression.
firstDayOfWeekVBDayOfWeekThe day the week starts on.
firstWeekOfYearVBFirstWeekOfYearThe week the year starts on.
Returns
- RuntimeSemanticsEvaluationResult<VBStringValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
InStr(VBVariantValue?, VBVariantValue?, VBVariantValue?, VBCompareMethod)
MS-VBAL 6.1.2.11.1.14 InStr Gets the position of the first occurrence of one string within another, or 0 when there is none.
RuntimeSemanticsEvaluationResult<VBVariantValue> InStr(VBVariantValue? arg1 = null, VBVariantValue? arg2 = null, VBVariantValue? arg3 = null, VBCompareMethod compare = VBCompareMethod.VBBinaryCompare)
Parameters
arg1VBVariantValueThe start position, or the string to search.
arg2VBVariantValueThe string to search, or the pattern to search for.
arg3VBVariantValueThe pattern to search for, when a start position was given.
compareVBCompareMethodThe string comparison to use. When omitted, the calling module's
Option Compare.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
👉 Its parameters are named for their position rather than for what they mean, because what they
mean depends on how many are supplied: with arg3 absent,
arg1 is the string searched and arg2 the pattern, from
position 1; with it present, arg1 is the start position,
arg2 the string searched and arg3 the pattern.
InStrB(VBVariantValue?, VBVariantValue?, VBVariantValue?, VBCompareMethod)
MS-VBAL 6.1.2.11.1.14 InStr Gets the position of the first occurrence of one string within another, or 0 when there is none.
RuntimeSemanticsEvaluationResult<VBVariantValue> InStrB(VBVariantValue? arg1 = null, VBVariantValue? arg2 = null, VBVariantValue? arg3 = null, VBCompareMethod compare = VBCompareMethod.VBBinaryCompare)
Parameters
arg1VBVariantValueThe start position, or the string to search.
arg2VBVariantValueThe string to search, or the pattern to search for.
arg3VBVariantValueThe pattern to search for, when a start position was given.
compareVBCompareMethodThe string comparison to use. When omitted, the calling module's
Option Compare.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
👉 Its parameters are named for their position rather than for what they mean, because what they
mean depends on how many are supplied: with arg3 absent,
arg1 is the string searched and arg2 the pattern, from
position 1; with it present, arg1 is the start position,
arg2 the string searched and arg3 the pattern.
InStrRev(VBStringValue, VBStringValue, VBLongValue?, VBCompareMethod)
MS-VBAL 6.1.2.11.1.15 InStrRev Gets the position of the last occurrence of one string within another, or 0 when there is none.
RuntimeSemanticsEvaluationResult<VBLongValue> InStrRev(VBStringValue stringCheck, VBStringValue stringMatch, VBLongValue? start = null, VBCompareMethod compare = VBCompareMethod.VBBinaryCompare)
Parameters
stringCheckVBStringValueThe string to search.
stringMatchVBStringValueThe pattern to search for.
startVBLongValueThe position to search back from.
-1, the default, searches from the last character.compareVBCompareMethodThe string comparison to use. When omitted, the calling module's
Option Compare.
Returns
- RuntimeSemanticsEvaluationResult<VBLongValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
👉 The page contradicts itself twice. Its parameter table says an omitted start is 1, "which means that the
search begins at the last character position", where its declaration says Optional Start As Long = -1: the declaration's
-1 is what is declared here. And the table says an omitted compare performs "a binary comparison", where its
runtime semantics say "if omitted, it uses the <option-compare-directive> of the calling module", as every other comparing
member's do: the runtime semantics are what is declared here.
Join(VBVariantValue, VBVariantValue?)
MS-VBAL 6.1.2.11.1.16 Join Gets a string of every element of an array, separated by a delimiter.
RuntimeSemanticsEvaluationResult<VBStringValue> Join(VBVariantValue sourceArray, VBVariantValue? delimiter = null)
Parameters
sourceArrayVBVariantValueThe one-dimensional array whose elements to join.
delimiterVBVariantValueWhat to separate the elements with. A single space when unspecified; a zero-length string joins them with nothing between.
Returns
- RuntimeSemanticsEvaluationResult<VBStringValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
👉 sourceArray is declared SourceArray() As Variant, and is a Variant here, as Filter(VBVariantValue, VBStringValue, VBBooleanValue?, VBCompareMethod)'s
is: so that Join(Split(s)) and Join(Array(...)) both reach the member.
LCase(VBVariantValue)
MS-VBAL 6.1.2.11.1.17 LCase Gets a string with every uppercase letter cased down.
RuntimeSemanticsEvaluationResult<VBVariantValue> LCase(VBVariantValue @string)
Parameters
stringVBVariantValueThe string to convert.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
LCaseString(VBVariantValue)
MS-VBAL 6.1.2.11.1.17 LCase Gets a string with every uppercase letter cased down.
[StdLibMember("LCase$")]
RuntimeSemanticsEvaluationResult<VBStringValue> LCaseString(VBVariantValue @string)
Parameters
stringVBVariantValueThe string to convert.
Returns
- RuntimeSemanticsEvaluationResult<VBStringValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
LTrim(VBVariantValue)
MS-VBAL 6.1.2.11.1.23 LTrim Gets a string with its leading spaces removed.
RuntimeSemanticsEvaluationResult<VBVariantValue> LTrim(VBVariantValue @string)
Parameters
stringVBVariantValueThe string to trim.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
LTrimString(VBVariantValue)
MS-VBAL 6.1.2.11.1.23 LTrim Gets a string with its leading spaces removed.
[StdLibMember("LTrim$")]
RuntimeSemanticsEvaluationResult<VBStringValue> LTrimString(VBVariantValue @string)
Parameters
stringVBVariantValueThe string to trim.
Returns
- RuntimeSemanticsEvaluationResult<VBStringValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Left(VBVariantValue, VBLongValue)
MS-VBAL 6.1.2.11.1.19 Left Gets a given number of characters from the start of a string.
RuntimeSemanticsEvaluationResult<VBVariantValue> Left(VBVariantValue @string, VBLongValue length)
Parameters
stringVBVariantValueThe string to take characters from.
lengthVBLongValueHow many characters to take. More than the string holds returns the whole string.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
LeftB(VBVariantValue, VBLongValue)
MS-VBAL 6.1.2.11.1.19 Left Gets a given number of characters from the start of a string.
RuntimeSemanticsEvaluationResult<VBVariantValue> LeftB(VBVariantValue @string, VBLongValue length)
Parameters
stringVBVariantValueThe string to take characters from.
lengthVBLongValueHow many characters to take. More than the string holds returns the whole string.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
LeftBString(VBVariantValue, VBLongValue)
MS-VBAL 6.1.2.11.1.19 Left Gets a given number of characters from the start of a string.
[StdLibMember("LeftB$")]
RuntimeSemanticsEvaluationResult<VBStringValue> LeftBString(VBVariantValue @string, VBLongValue length)
Parameters
stringVBVariantValueThe string to take characters from.
lengthVBLongValueHow many characters to take. More than the string holds returns the whole string.
Returns
- RuntimeSemanticsEvaluationResult<VBStringValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
LeftString(VBVariantValue, VBLongValue)
MS-VBAL 6.1.2.11.1.19 Left Gets a given number of characters from the start of a string.
[StdLibMember("Left$")]
RuntimeSemanticsEvaluationResult<VBStringValue> LeftString(VBVariantValue @string, VBLongValue length)
Parameters
stringVBVariantValueThe string to take characters from.
lengthVBLongValueHow many characters to take. More than the string holds returns the whole string.
Returns
- RuntimeSemanticsEvaluationResult<VBStringValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Len(VBVariantValue)
MS-VBAL 6.1.2.11.1.22 Len Gets the number of characters in a string, or the number of bytes a value of some other type occupies.
RuntimeSemanticsEvaluationResult<VBVariantValue> Len(VBVariantValue expression)
Parameters
expressionVBVariantValueThe string, or a variable of any type.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
LenB(VBVariantValue)
MS-VBAL 6.1.2.11.1.22 Len Gets the number of characters in a string, or the number of bytes a value of some other type occupies.
RuntimeSemanticsEvaluationResult<VBVariantValue> LenB(VBVariantValue expression)
Parameters
expressionVBVariantValueThe string, or a variable of any type.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Mid(VBVariantValue, VBLongValue, VBVariantValue?)
MS-VBAL 6.1.2.11.1.25 Mid Gets a given number of characters of a string, from a given position.
RuntimeSemanticsEvaluationResult<VBVariantValue> Mid(VBVariantValue @string, VBLongValue start, VBVariantValue? length = null)
Parameters
stringVBVariantValueThe string to take characters from.
startVBLongValueThe 1-based position of the first character to take.
lengthVBVariantValueHow many characters to take. Everything from
startto the end of the string when unspecified.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
MidB(VBVariantValue, VBLongValue, VBVariantValue?)
MS-VBAL 6.1.2.11.1.25 Mid Gets a given number of characters of a string, from a given position.
RuntimeSemanticsEvaluationResult<VBVariantValue> MidB(VBVariantValue @string, VBLongValue start, VBVariantValue? length = null)
Parameters
stringVBVariantValueThe string to take characters from.
startVBLongValueThe 1-based position of the first character to take.
lengthVBVariantValueHow many characters to take. Everything from
startto the end of the string when unspecified.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
MidBString(VBVariantValue, VBLongValue, VBVariantValue?)
MS-VBAL 6.1.2.11.1.25 Mid Gets a given number of characters of a string, from a given position.
[StdLibMember("MidB$")]
RuntimeSemanticsEvaluationResult<VBStringValue> MidBString(VBVariantValue @string, VBLongValue start, VBVariantValue? length = null)
Parameters
stringVBVariantValueThe string to take characters from.
startVBLongValueThe 1-based position of the first character to take.
lengthVBVariantValueHow many characters to take. Everything from
startto the end of the string when unspecified.
Returns
- RuntimeSemanticsEvaluationResult<VBStringValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
MidString(VBVariantValue, VBLongValue, VBVariantValue?)
MS-VBAL 6.1.2.11.1.25 Mid Gets a given number of characters of a string, from a given position.
[StdLibMember("Mid$")]
RuntimeSemanticsEvaluationResult<VBStringValue> MidString(VBVariantValue @string, VBLongValue start, VBVariantValue? length = null)
Parameters
stringVBVariantValueThe string to take characters from.
startVBLongValueThe 1-based position of the first character to take.
lengthVBVariantValueHow many characters to take. Everything from
startto the end of the string when unspecified.
Returns
- RuntimeSemanticsEvaluationResult<VBStringValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
MonthName(VBLongValue, VBBooleanValue?)
MS-VBAL 6.1.2.11.1.28 MonthName Gets the name of a month, in the environment's own regional settings.
RuntimeSemanticsEvaluationResult<VBStringValue> MonthName(VBLongValue month, VBBooleanValue? abbreviate = null)
Parameters
monthVBLongValueThe 1-based number of the month.
abbreviateVBBooleanValueTruefor the abbreviated name.
Returns
- RuntimeSemanticsEvaluationResult<VBStringValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
RTrim(VBVariantValue)
MS-VBAL 6.1.2.11.1.23 RTrim Gets a string with its trailing spaces removed.
RuntimeSemanticsEvaluationResult<VBVariantValue> RTrim(VBVariantValue @string)
Parameters
stringVBVariantValueThe string to trim.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
RTrimString(VBVariantValue)
MS-VBAL 6.1.2.11.1.23 RTrim Gets a string with its trailing spaces removed.
[StdLibMember("RTrim$")]
RuntimeSemanticsEvaluationResult<VBStringValue> RTrimString(VBVariantValue @string)
Parameters
stringVBVariantValueThe string to trim.
Returns
- RuntimeSemanticsEvaluationResult<VBStringValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Repeat(VBLongValue, VBVariantValue)
MS-VBAL 6.1.2.11.1.38 String Gets a string of a given character, repeated a given number of times.
[StdLibMember("String")]
RuntimeSemanticsEvaluationResult<VBVariantValue> Repeat(VBLongValue number, VBVariantValue character)
Parameters
numberVBLongValueHow many times to repeat the character.
characterVBVariantValueThe character to repeat, as a character code or as a string whose first character is used.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
👉 Its VBA name is String, which is also a reserved type name — so it is stated here rather
than taken from this method's own, which cannot be it.
RepeatString(VBLongValue, VBVariantValue)
MS-VBAL 6.1.2.11.1.38 String Gets a string of a given character, repeated a given number of times.
[StdLibMember("String$")]
RuntimeSemanticsEvaluationResult<VBStringValue> RepeatString(VBLongValue number, VBVariantValue character)
Parameters
numberVBLongValueHow many times to repeat the character.
characterVBVariantValueThe character to repeat, as a character code or as a string whose first character is used.
Returns
- RuntimeSemanticsEvaluationResult<VBStringValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
👉 Its VBA name is String, which is also a reserved type name — so it is stated here rather
than taken from this method's own, which cannot be it.
Replace(VBStringValue, VBStringValue, VBStringValue, VBLongValue?, VBLongValue?, VBCompareMethod)
MS-VBAL 6.1.2.11.1.29 Replace Gets a string with a number of occurrences of one substring replaced by another.
RuntimeSemanticsEvaluationResult<VBStringValue> Replace(VBStringValue expression, VBStringValue find, VBStringValue replace, VBLongValue? start = null, VBLongValue? count = null, VBCompareMethod compare = VBCompareMethod.VBBinaryCompare)
Parameters
expressionVBStringValueThe string to search.
findVBStringValueThe substring to search for.
replaceVBStringValueWhat to replace it with.
startVBLongValueThe 1-based position to start at,
1when omitted. The returned string begins there, not at the start ofexpression.countVBLongValueHow many occurrences to replace.
-1, the default, replaces every one of them.compareVBCompareMethodThe string comparison to use. When omitted, the calling module's
Option Compare.
Returns
- RuntimeSemanticsEvaluationResult<VBStringValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
The type library declares every parameter by reference (StdLibTypeLibraryByRefAttribute): Replace(ByVal s, ...) is a compile error,
whichever argument is written ByVal (MS-VBA, recorded in Excel).
Right(VBVariantValue, VBLongValue)
MS-VBAL 6.1.2.11.1.30 Right Gets a given number of characters from the end of a string.
RuntimeSemanticsEvaluationResult<VBVariantValue> Right(VBVariantValue @string, VBLongValue length)
Parameters
stringVBVariantValueThe string to take characters from.
lengthVBLongValueHow many characters to take. More than the string holds returns the whole string.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
RightB(VBVariantValue, VBLongValue)
MS-VBAL 6.1.2.11.1.30 Right Gets a given number of characters from the end of a string.
RuntimeSemanticsEvaluationResult<VBVariantValue> RightB(VBVariantValue @string, VBLongValue length)
Parameters
stringVBVariantValueThe string to take characters from.
lengthVBLongValueHow many characters to take. More than the string holds returns the whole string.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
RightBString(VBVariantValue, VBLongValue)
MS-VBAL 6.1.2.11.1.30 Right Gets a given number of characters from the end of a string.
[StdLibMember("RightB$")]
RuntimeSemanticsEvaluationResult<VBStringValue> RightBString(VBVariantValue @string, VBLongValue length)
Parameters
stringVBVariantValueThe string to take characters from.
lengthVBLongValueHow many characters to take. More than the string holds returns the whole string.
Returns
- RuntimeSemanticsEvaluationResult<VBStringValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
RightString(VBVariantValue, VBLongValue)
MS-VBAL 6.1.2.11.1.30 Right Gets a given number of characters from the end of a string.
[StdLibMember("Right$")]
RuntimeSemanticsEvaluationResult<VBStringValue> RightString(VBVariantValue @string, VBLongValue length)
Parameters
stringVBVariantValueThe string to take characters from.
lengthVBLongValueHow many characters to take. More than the string holds returns the whole string.
Returns
- RuntimeSemanticsEvaluationResult<VBStringValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Space(VBLongValue)
MS-VBAL 6.1.2.11.1.33 Space Gets a string of a given number of spaces.
RuntimeSemanticsEvaluationResult<VBVariantValue> Space(VBLongValue number)
Parameters
numberVBLongValueHow many spaces.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
SpaceString(VBLongValue)
MS-VBAL 6.1.2.11.1.33 Space Gets a string of a given number of spaces.
[StdLibMember("Space$")]
RuntimeSemanticsEvaluationResult<VBStringValue> SpaceString(VBLongValue number)
Parameters
numberVBLongValueHow many spaces.
Returns
- RuntimeSemanticsEvaluationResult<VBStringValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Split(VBStringValue, VBVariantValue?, VBLongValue?, VBCompareMethod)
MS-VBAL 6.1.2.11.1.35 Split Gets a zero-based array of the substrings of a string, split on a delimiter.
RuntimeSemanticsEvaluationResult<VBVariantValue> Split(VBStringValue expression, VBVariantValue? delimiter = null, VBLongValue? limit = null, VBCompareMethod compare = VBCompareMethod.VBBinaryCompare)
Parameters
expressionVBStringValueThe string to split. A zero-length string yields an array with no elements at all.
delimiterVBVariantValueWhat to split on. A single space when unspecified.
limitVBLongValueHow many substrings to return at most.
-1, the default, returns all of them.compareVBCompareMethodThe string comparison to use. When omitted, the calling module's
Option Compare.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
StrComp(VBVariantValue, VBVariantValue, VBCompareMethod)
MS-VBAL 6.1.2.11.1.36 StrComp Gets -1, 0 or 1 as one string sorts before, with, or after another.
RuntimeSemanticsEvaluationResult<VBVariantValue> StrComp(VBVariantValue string1, VBVariantValue string2, VBCompareMethod compare = VBCompareMethod.VBBinaryCompare)
Parameters
string1VBVariantValueThe first string.
string2VBVariantValueThe second string.
compareVBCompareMethodThe string comparison to use. When omitted, the calling module's
Option Compare.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
StrConv(VBVariantValue, VBStrConv, VBLongValue?)
MS-VBAL 6.1.2.11.1.37 StrConv Gets a string converted as a VBStrConv conversion says — cased, widened, narrowed, or transliterated.
RuntimeSemanticsEvaluationResult<VBVariantValue> StrConv(VBVariantValue @string, VBStrConv conversion, VBLongValue? localeID = null)
Parameters
stringVBVariantValueThe string to convert.
conversionVBStrConvWhich conversion to apply.
localeIDVBLongValueThe locale to convert for; the environment's own when omitted.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
👉 The specification declares localeID required, with no Optional; it is optional here, with no default, because
the documented form of a call - and most code - passes two arguments, and the environment's own locale is what a conversion that is
given none uses.
StrReverse(VBStringValue)
MS-VBAL 6.1.2.11.1.40 StrReverse Gets a string with its characters in reverse order.
RuntimeSemanticsEvaluationResult<VBStringValue> StrReverse(VBStringValue expression)
Parameters
expressionVBStringValueThe string to reverse.
Returns
- RuntimeSemanticsEvaluationResult<VBStringValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Trim(VBVariantValue)
MS-VBAL 6.1.2.11.1.23 Trim Gets a string with both its leading and its trailing spaces removed.
RuntimeSemanticsEvaluationResult<VBVariantValue> Trim(VBVariantValue @string)
Parameters
stringVBVariantValueThe string to trim.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
TrimString(VBVariantValue)
MS-VBAL 6.1.2.11.1.23 Trim Gets a string with both its leading and its trailing spaces removed.
[StdLibMember("Trim$")]
RuntimeSemanticsEvaluationResult<VBStringValue> TrimString(VBVariantValue @string)
Parameters
stringVBVariantValueThe string to trim.
Returns
- RuntimeSemanticsEvaluationResult<VBStringValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
UCase(VBVariantValue)
MS-VBAL 6.1.2.11.1.41 UCase Gets a string with every lowercase letter cased up.
RuntimeSemanticsEvaluationResult<VBVariantValue> UCase(VBVariantValue @string)
Parameters
stringVBVariantValueThe string to convert.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
UCaseString(VBVariantValue)
MS-VBAL 6.1.2.11.1.41 UCase Gets a string with every lowercase letter cased up.
[StdLibMember("UCase$")]
RuntimeSemanticsEvaluationResult<VBStringValue> UCaseString(VBVariantValue @string)
Parameters
stringVBVariantValueThe string to convert.
Returns
- RuntimeSemanticsEvaluationResult<VBStringValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
WeekdayName(VBLongValue, VBBooleanValue?, VBDayOfWeek)
MS-VBAL 6.1.2.11.1.43 WeekdayName Gets the name of a day of the week, in the environment's own regional settings.
RuntimeSemanticsEvaluationResult<VBStringValue> WeekdayName(VBLongValue weekday, VBBooleanValue? abbreviate = null, VBDayOfWeek firstDayOfWeek = VBDayOfWeek.VBUseSystemDayOfWeek)
Parameters
weekdayVBLongValueThe number of the day within the week, counted from
firstDayOfWeek.abbreviateVBBooleanValueTruefor the abbreviated name.firstDayOfWeekVBDayOfWeekThe day the week starts on.
Returns
- RuntimeSemanticsEvaluationResult<VBStringValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.