| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Returns the position of the first upper case letter in a character string.
PosUpper( <cString> , ;
[<lNoUpper>] , ;
[<nSkipChars>] ) --> nPos
Depending on <lNoUpper>, the function returns the position of the first (non)upper case character in <cString> as a numeric value.
| See also: | PosAlpha(), PosLower(), PosRange() |
| Category: | CT:String manipulation , Character functions |
| Source: | ct\pos1.c |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example displays results of PosUpper()
PROCEDURE Main
LOCAL cString := "xHarbour Compiler"
LOCAL nPos, cChr
? nPos := PosUpper( cString ) // result: 2
? cChr := cString[ nPos ], ; // result: H 72
Asc( cChr )
? nPos := PosUpper( cString, .F., nPos ) // result: 10
? cChr := cString[ nPos ], ; // result: C 67
Asc( cChr )
? nPos := PosUpper( cString, .T. ) // result: 1
? cChr := cString[ nPos ], ; // result: x 120
Asc( cChr )
RETURN
http://www.xHarbour.com