xHarbour Reference Documentation > Function Reference |
Returns the position of the first alphabetic characters in a character string.
PosAlpha( <cString> , ; [<lNoAlpha>] , ; [<nSkipChars>] ) --> nPos
Depending on <lNoAlpha>, the function returns the position of the first (non)alphabetic character in <cString> as a numeric value.
See also: | PosLower(), PosRange(), PosUpper() |
Category: | CT:String manipulation , Character functions |
Source: | ct\pos1.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example displays results of PosAlpha() PROCEDURE Main LOCAL cString := "January 18th, 2007" LOCAL nPos, cChr ? nPos := PosAlpha( cString ) // result: 1 ? cChr := cString[ nPos ], ; // result: J 74 Asc( cChr ) ? nPos := PosAlpha( cString, .T. ) // result: 8 ? cChr := cString[ nPos ], ; // result: 32 Asc( cChr ) ? nPos := PosAlpha( cString, .F., nPos ) // result: 11 ? cChr := cString[ nPos ], ; // result: t 116 Asc( cChr ) RETURN
http://www.xHarbour.com