xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

PosUpper()

Returns the position of the first upper case letter in a character string.

Syntax

PosUpper( <cString>   , ;
         [<lNoUpper>] , ;
         [<nSkipChars>] ) --> nPos

Arguments

<cString>
This is the character string to search for the first upper case charatcer.
<lNoLower>
This parameter defaults to .F. (false) so that the first upper case character is searched. Passing .T. (true) instructs the function to search for the first non-upper case character.
<nSkipChars>
This numeric parameter defaults to 0 so that the function begins searching with the first character of <cString>. Passing a value > 0 instructs the function to ignore the first <nSkipChars> characters in the search.

Return

Depending on <lNoUpper>, the function returns the position of the first (non)upper case character in <cString> as a numeric value.

Info

See also:PosAlpha(), PosLower(), PosRange()
Category: CT:String manipulation , Character functions
Source:ct\pos1.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

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

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe