String Class Function Manual

ASC

| HOME | BACK |

Purpose

To return the ASCII code of the first character of a string.

Class

String

Usage

{int} ret  =  object.ASC()

Example:

->a = "A"
->a.asc()

ans = 65

See also (class function)

val

| HOME | BACK |


CAT

| HOME | BACK |

Purpose

To concatenate two string.  The calling string will be concatenated by the argument string.

Class

String

Usage

{String} ret  =  object.CAT({String} argm1)

argm1 = string to concatenate

Example:

->a = "My name "
->b = " is Nobeed"
->a.cat(b)

ans = My name is Nobeed

->

See also (class function)

string operator +

| HOME | BACK |


EXTRACT

| HOME | BACK |

Purpose

To extract a number of string, separated by at least one space, from a string.

The result strings are store in a vector of string, a VecStr object.  Spaces in front and after the result strings are trimmed.

Class

String

Usage

{VecStr} ret  =  object.EXTRACT({int} argm1)

argm1 = number of strings to be extracted

Example:

->a = "My name is Noobeed"
->v = a.extract(2)
->print v

Vector size : 2

My
name


->

See also (class function)

no_word

| HOME | BACK |


FIND

| HOME | BACK |

Purpose

To find a string inside a string.  If found the function return the first position at which the string is found, otherwise it return -1. 

Please note that the first position of a string is 0, zero.

Class

String

Usage

{int} ret  =  object.FIND({String} argm1)

argm1 = string to be found

Example:

->a = "My name is Noobeed"
->b = "Noobeed"
->a.find(b)

ans = 11

->

See also (class function)

findfrom, findlast

| HOME | BACK |


FINDFROM

| HOME | BACK |

Purpose

To find a string inside a string.  This function starts searching the string from a specific position, specified by the user.  If found the function return the first position at which the string is found, otherwise it return -1. 

Please note that the first position of a string is 0, zero.

Class

String

Usage

{int} ret  =  object.FINDFROM({String} argm1,{int} argm2)

argm1 = string to be found

argm2 = position to start seraching

Example:

->a = "Noobeed Noobeed Noobeed"
->b = "Noobeed"
->a.findfrom(b,1)

ans = 8

->

See also (class function)

find, findlast

| HOME | BACK |


FINDLAST

| HOME | BACK |

Purpose

To find the last occurrence of a string inside a string.  If found the function return the last position at which of the last occurrence of the string found, otherwise it return -1. 

Please note that the first position of a string is 0, zero.

Class

String

Usage

{int} ret  =  object.FINDLAST({String} argm1)

argm1 = string to be found

Example:

->a = "Noobeed and Noobeed love you"
->b = "Noobeed"
->a.findlast(b)

ans = 18

->

See also (class function)

findfrom, find

| HOME | BACK |


LEFT

| HOME | BACK |

Purpose

To extract a portion of a string from the left.

Class

String

Usage

{String} ret  =  object.LEFT({int} argm1)

argm1 = number of characters being extracted

Example:

->a = "My name is Noobeed"
->b = a.left(9)
->print b
My name i
->

See also (class function)

right, sub

| HOME | BACK |


LEN

| HOME | BACK |

Purpose

To report the length of a string.

Class

String

Usage

{int} ret  =  object.LEN()

Example:

->a = "My name is Noobeed"
->a.len()

ans = 18

->

See also (class function)

no_word

| HOME | BACK |


LOWER

| HOME | BACK |

Purpose

To change characters in a string to lowercase.  Lowercase characters and numbers are not effected by this function.

Class

String

Usage

{String} ret  =  object.LOWER()

Example:

->a = "NOOBEED Version 1.9"
->b = a.lower()
->print b
noobeed version 1.9
->

See also (class function)

upper

| HOME | BACK |


LTRIM

| HOME | BACK |

Purpose

To remove all white spaces in front of a string.

Class

String

Usage

{String} ret  =  object.LTRIM()

Example:

->a = "    Noobeed"
->print a
    Noobeed
->b = a.ltrim()
->print b
Noobeed
->

See also (class function)

rtrim

| HOME | BACK |


NO_WORD

| HOME | BACK |

Purpose

To report the number of words, separated by at least one space, in a string.

Class

String

Usage

{int} ret  =  object.NO_WORD()

Example:

->a = "My name is Noobeed"
->a.no_word()

ans = 4

->

See also (class function)

extract

| HOME | BACK |


REVERSE

| HOME | BACK |

Purpose

To reverse a string.  If a string contains more than one word, the function will as well reverse the order of words as well as the content of each word.

Class

String

Usage

{String} ret  =  object.REVERSE()

Example:

->a = "My name is Noobeed"
->b = a.reverse()
->print b
deebooN si eman yM
->

See also (class function)

no_word

| HOME | BACK |


RIGHT

| HOME | BACK |

Purpose

To extract a portion of a string from the right.

Class

String

Usage

{String} ret  =  object.RIGHT({int} argm1)

argm1 = number of characters being extracted

Example:

->a = "My name is Noobeed"
->b = a.right(7)
->print b
Noobeed
->

See also (class function)

left, sub

| HOME | BACK |


RTRIM

| HOME | BACK |

Purpose

To remove all white spaces at the end of a string.

Class

String

Usage

{String} ret  =  object.RTRIM()

Example:

->a = "Noobeed     "
->a.len()

ans = 12

->b = a.rtrim()
->b.len()

ans = 7

->

See also (class function)

ltrim

| HOME | BACK |


SUB

| HOME | BACK |

Purpose

To extract a portion of a string from a specific position to a specific position.  Please note that the first position of a string is 0, zero.

Class

String

Usage

{String} ret  =  object.SUB({int} argm1, {int} argm2)

argm1 = start position

argm2 = end position

Example:

->a = "My name is Noobeed"
->b = a.sub(3,9)
->print b
name is
->

See also (class function)

left, right

| HOME | BACK |


UPPER

| HOME | BACK |

Purpose

To change characters in a string to uppercase.  Uppercase characters and numbers are not effected by this function.

Class

String

Usage

{String} ret  =  object.UPPER()

Example:

->a = "NOOBEED Version 1.9"
->b = a.upper()
->print b
NOOBEED VERSION 1.9
->

See also (class function)

lower

| HOME | BACK |


VAL

| HOME | BACK |

Purpose

To converse a string to a number.

Class

String

Usage

{double} ret  =  object.VAL()

Example:

->a = "20"
->a.val()

ans = 20.00000

->a = "15.2563"
->a.val()

ans = 15.25630

->a = "ABC"
->a.val()

Error in val(Str): < ABC > not a numerical constant...

->

See also (class function)

asc

| HOME | BACK |