Harbour All Functions – A

AAdd
Abs
AChoice
AClone
ACopy
ACos

ADays
AddASCII
AddMonth
ADel
ADir
AfterAtNum
AEval
AFields
AFill
AIns
Alert
Alias
AllTrim

AMonths
Array
Asc
AScan
ASCIISum
ASCPos
ASin
ASize
ASort
At
AtAdjust
ATail
ATan
ATn2
AtNum
AtRepl
AtToken

String Functions

AddASCII

AfterAtNum

AllTrim
Asc

ASCIISum

ASCPos
At

AtAdjust

AtNum
AtRepl
AtToken

BeforAtNum

Chr

CharAdd
CharAnd
CharEven
CharHist
CharList
CharMirr
CharMix
CharNoList
CharNot
CharOdd
CharOne
CharOnly
CharOr
CharPix
CharRela
CharRelRep
CharRem
CharRepl
CharRLL
CharRLR
CharSHL
CharSHR
CharSList
CharSort
CharSub
CharSwap
CharWin
CharXOR

CountLeft
CountRight
Descend
Empty
hb_At
hb_RAt
hb_ValToStr
IsAlpha
IsDigit
IsLower
IsUpper

JustLeft
JustRight

Left
Len
Lower
LTrim

NumAt
NumToken
PadLeft
PadRight

PadC
PadL
PadR

POSALPHA
POSCHAR
POSDEL
POSDIFF
POSEQUAL
POSINS
POSLOWER
POSRANGE
POSREPL
POSUPPER

RangeRem
RangeRepl

RAt

RemAll

RemLeft
RemRight
ReplAll

Replicate

ReplLeft

ReplRight

RestToken

Right
RTrim

SaveToken

SetAtLike
Space
Str

StrDiff

StrFormat

StrSwap

StrTran
StrZero
SubStr

TabExpand
TabPack

Token

TokenAt
TokenEnd
TokenExit
TokenInit
TokenLower
TokenNext
TokenNum
TokenSep
TokenUpper

Transform
Trim
Upper
Val

ValPos
WordOne
WordOnly
WordRem
WordRepl
WordSwap

WordToChar


SubStr()

SubStr()

Returns a substring from a main string

Syntax

      SubStr( <cString>,  <nStart>,  [<nLen>] ) --> cReturn

Arguments

<cString> Character expression to be parsed

<nStart> Start position

<nLen> Number of characters to return

Returns

<cReturn> Substring of evaluation

Description

This functions returns a character string formed from <cString>, starting at the position of <nStart> and continuing on for a length of <nLen> characters. If <nLen> is not specified, the value will be all remaining characters from the position of <nStart>.

The value of <nStart> may be negative. If it is, the direction of operation is reversed from a default of left-to-right to right-to-left for the number of characters specified in <nStart>. If the number of characters from <nStart> to the end of the string is less than <nLen> the rest are ignored.

Examples

      ? SubStr( "HELLO HARBOUR" ,   7,  4 )      // HARB
      ? SubStr( "HELLO HARBOUR" ,  -3,  3 )      // OUR
      ? SubStr( "HELLO HARBOUR" ,   7    )      // HARBOUR

Compliance

Clipper

Platforms

All(64K)

Files

Library is core

Seealso

Left(), At(), Right()

StrTran()

StrTran()

Translate substring value with a main string

Syntax

      StrTran( <cString>,  <cLocString>,  [<cRepString>],  
               [<nPos>], [<nOccurrences>] ) --> cReturn

Arguments

<cString> The main string to search

<cLocString> The string to locate in the main string

<cRepString> The string to replace the <cLocString>

<nPos> The first occurrence to be replaced

<nOccurrences> Number of occurrence to replace

Returns

<cReturn> Formated string

Description

This function searches for any occurrence of <cLocString> in <cString> and replaces it with <cRepString>. If <cRepString> is not specified, a NULL byte will replace <cLocString>.

If <nPos> is used, its value defines the first occurrence to be replaced. The default value is 1. Additionally, if used, the value of <nOccurrences> tell the function how many occurrences of <cLocString> in <cString> are to the replaced. The default of <nOccurrences> is all occurrences.

Examples

      ? StrTran( "Harbour  Power",  "  ",  " " )   // Harbour Power
      // Harbour Power The future  of  xBase
      ? StrTran( "Harbour  Power  The Future  of  xBase",  "  ",  " " ,  ,  2 )

Compliance

Clipper

Platforms

All(64K)

Files

Libraty is rtl

Seealso

SubStr(), At()

Right()

RIGHT()

Extract the rightmost substring of a character expression

Syntax

      RIGHT( <cString>, <nLen> ) --> cReturn

Arguments

<cString> Character expression to be parsed

<nLen> Number of bytes to return beginning at the rightmost position

Returns

<cReturn> Substring of evaluation

Description

This functions returns the rightmost <nLen> characters of <cString>. It is equivalent to the following expressions:

SUBSTR( <cString>, – <nLen> )

SUBSTR( <cString>, LEN( <cString> ) – <nLen> + 1, <nLen> )

Examples

      ? RIGHT( "HELLO HARBOUR", 5 )     // RBOUR

Compliance

Clipper

Platforms

All

Files

Library is rtl

Seealso

SUBSTR(), LEFT(), AT(), RAT()

RAt()

RAT()

Searches for a substring from the right side of a string.

Syntax

      RAT( <cSearch>, <cString> ) --> nPos

Arguments

<cSearch> Substring to search for

<cString> Main string

Returns

RAT() return the location of beginning position.

Description

This function searches through <cString> for the first existence of <cSearch>. The search operation is performed from the right side of <cString> to the left. If the function is unable to find any occurrence of <cSearch> in <cString>, the return value is 0.

Examples

      ? 'RAt( "cde", "abcdefgfedcba" ) = ' +;
         RAt( "cde", "abcsefgfedcba" )

Compliance

Clipper

Platforms

All  (64K)

Files

Library is rtl

Seealso

AT(), SUBSTR(), RIGHT()

Left()

LEFT()

Extract the leftmost substring of a character expression

Syntax

      LEFT( <cString>, <nLen> ) --> cReturn

Arguments

<cString> Main character to be parsed

<nLen> Number of bytes to return beginning at the leftmost position

Returns

<cReturn> Substring of evaluation

Description

This functions returns the leftmost <nLen> characters of <cString>. It is equivalent to the following expression:

SUBSTR( <cString>, 1, <nLen> )

Examples

      ? LEFT( "HELLO HARBOUR", 5 )    // HELLO

Compliance

Clipper

Platforms

All

Files

Library is rtl

Seealso

SUBSTR(), RIGHT(), AT(), RAT()