File

src/helpers/visualBasic.ts/visualBasic.ts

Index

Methods

Methods

Static asc
asc(value: string)

Returns the asc code for the first char in the value.

Parameters :
Name Type Optional Description
value string No

The string value.

Returns : number

The asc code.

Static chr
chr(charCode: number)

Converts the input to a char.

Parameters :
Name Type Optional Description
charCode number No

The char code.

Returns : string

The resulting string value.

Static inStr
inStr(string1: string, string2: string, compare: CompareMethod)

Determines whether string1 contains the string2.

Parameters :
Name Type Optional Default value Description
string1 string No

The first string value that contains the target.

string2 string No

The second string value to be found.

compare CompareMethod No CompareMethod.Binary
Returns : number

The index where the value was found.

Static inStr1
inStr1(start: number, string1: string, string2: string, compare: CompareMethod)

Determines whether string1 contains the string2.

Parameters :
Name Type Optional Default value Description
start number No

The index position where start to find.

string1 string No

The first string value that contains the target.

string2 string No

The second string value to be found.

compare CompareMethod No CompareMethod.Binary
Returns : number

The index where the value was found.

Static len
len(string: string)

len method, return the length of the string *

Parameters :
Name Type Optional
string string No
Returns : number

{number}

Static replace
replace(expression: string, find: string, replacement: string, start: number, count, compare: CompareMethod)

Replace the find value with the replacement value into the given expression.

Parameters :
Name Type Optional Default value Description
expression string No

The original expression.

find string No

The value to be found.

replacement string No

The value to replace.

start number No 1

The positive index in the expression where the replacement should start.

count No -1

The maximun number of replacements.

compare CompareMethod No CompareMethod.Binary

The compare method.

Returns : string

The new expression with the replacements.

Private Static replaceInternal
replaceInternal(expression: string, find: string, replacement: string, start: number, count: number, compare: CompareMethod)

Replaces the given find with the replacement in the expression. The replament can indicates custom values as start, count and compare method.

Parameters :
Name Type Optional Description
expression string No

The expression where the action should be applied.

find string No

The statement to be found.

replacement string No

The statement to replace.

start number No

Indicates the index where the algorithm should start.

count number No

Indicates the number of replacements.

compare CompareMethod No

The compare method.

Returns : string

The new expression with the replacements.

Static strConv
strConv(string: string, vbStrConv: VbStrConv)

strConv just support upperCase and return the text in upperCase

Parameters :
Name Type Optional
string string No
vbStrConv VbStrConv No
Returns : string

{string}

Private Static validateReplaceStart
validateReplaceStart(start: number)

Validates replace start number is greather than 1.

Parameters :
Name Type Optional Description
start number No

The start value.

Returns : void
Private Static validatReplaceCount
validatReplaceCount(count: number)

Validats replace count is positive

Parameters :
Name Type Optional Description
count number No

The count of replacements.

Returns : void

results matching ""

    No results matching ""