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 |


COUNT

| HOME | BACK |

Purpose

To count the number of a string inside a string.  If found the function return the number of the string, otherwise return 0. 

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

Class

String

Usage

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

argm1 = string to be count

Example:

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

ans = 1

->

See also (class function)

countfrom

| HOME | BACK |


COUNTFROM

| HOME | BACK |

Purpose

To count the number of a string inside a string, starting from a specific position given by the user.  If found the function return the number of the string, otherwise return 0. 

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.countfrom(b,1)

ans = 2

->

See also (class function)

count

| HOME | BACK |


 DEL

| HOME | BACK |

Purpose

To delete a string from a string.  A copy of the calling string will be searched theough out and, if the given string, specified by the argument, is found, it will be deleted and stored as the result.

Class

String

Usage

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

argm1 = string to be searched, and if found, will be deleted

Example:

->s = "red green blue blue green red red green"
->s1 = s.del("green")
...3 deleted...
->s1

ans = red blue blue red red

->

See also (class function)

replace subreplace

| HOME | BACK |


 EXTRACT

| HOME | BACK |

Purpose

To extract a number of strings, 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 |


EXTRACTCSV

| HOME | BACK |

Purpose

To extract a number of strings, separated by a commaa sign, 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 not trimmed.

Class

String

Usage

{VecStr} ret  =  object.EXTRACTCSV({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, extract

| 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 |


REPLACE

| HOME | BACK |

Purpose

To find and replace a sub-string with a sub-string, both of which are specified by the user.  The length of the replaced and replacing sub-string must be equal.

 

Class

String

Usage

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

argm1 = the replaced sub-string.

argm2 = the replacing sub-string.

Example:

->a = "My name is Noobeed"
->b = a.subreplace("Noobeed", "Deeboon")
->print b
My name is Deeboon
->

See also (class function)

subreplace

| 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 |


SUBREPLACE

| HOME | BACK |

Purpose

To replace a sub-string into a string at the position given by the start and end positions specified by the user.  The length of the sub-string must be exactly fitted into the specified positions.

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

Class

String

Usage

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

argm1 = start position

argm2 = end position

argm3 = the replacing sub-string.

Example:

->a = "My name is Noobeed"
->b = a.subreplace(11,17, "Deeboon")
->print b
My name is Deeboon
->

See also (class function)

replace

| 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 |


VECTOR

| HOME | BACK |

Purpose

To converse a string to a Vector of Integer object.

Class

String

Usage

{VecInt} ret  =  object.VECTOR()

Example:

->s = "ABCdef"
->v = s.vector()
->v

ans =
Vector size : 6

65
66
67
100
101
102




->

See also (class function)

asc

| HOME | BACK |