# TOKENUPPER()

Change the first letter of tokens to upper case

Syntax

  TOKENUPPER (<[@]cString>, [<cTokenizer>], [<nTokenCount>],
  [<nSkipWidth>]) -> cString

Arguments

  <[@]cString> is the processed string [<cTokenizer>] is a list of characters separating the tokens in <cString> Default: chr(0)+chr(9)+chr(10)+chr(13)+chr(26)+ chr(32)+chr(32)+chr(138)+chr(141)+ ",.;:!\?/\\<>()#&%+-*" [<nTokenCount>] specifies the number of tokens that should be processed Default: all tokens [<nSkipWidth>] specifies the maximum number of successive tokenizing characters that are combined as ONE token stop, e.g. specifying 1 can yield to empty token Default: 0, any number of successive tokenizing characters are combined as ONE token stop

Returns

  <cString> the string with the uppercased tokens

Description

  The TOKENUPPER() function changes the first letter of tokens in <cString> to upper case. To do this, it uses the same tokenizing mechanism as the token() function. If TOKENUPPER() extracts a token that starts with a letter, this letter will be changed to upper case. You can omit the return value of this function by setting the CSETREF() switch to .T., but you must then pass <cString> by reference to get the result.

Examples

          ? tokenupper("Hello, world, here I am!")       // "Hello, World, Here I Am!"
          ? tokenupper("Hello, world, here I am!",,3)    // "Hello, World, Here I am!"
          ? tokenupper("Hello, world, here I am!",",",3) // "Hello, world, here I am!"
          ? tokenupper("Hello, world, here I am!"," w")  // "Hello, wOrld, Here I Am!"
    Tests
          tokenupper("Hello, world, here I am!")       == "Hello, World, Here I Am!"
          tokenupper("Hello, world, here I am!",,3)    == "Hello, World, Here I am!"
          tokenupper("Hello, world, here I am!",",",3) == "Hello, world, here I am!"
          tokenupper("Hello, world, here I am!"," w")  == "Hello, wOrld, Here I Am!"

Status

  Ready

Compliance

  TOKENUPPER() is compatible with CT3's TOKENUPPER(), but a new 4th parameter, <nSkipWidth> has been added for synchronization with the the other token functions.

Platforms

  All

Files

  Source is token1.c, library is libct.

See Also

- TOKEN()
- NUMTOKEN()
- ATTOKEN()
- TOKENLOWER()
- TOKENSEP()
- CSETREF()