| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Returns the number of tokens in a string.
NumToken( <cString> , ;
[<cDelimiter>], ;
[<nSkipWidth>] ) --> nCount
The function returns the number of tokens found in a string as a numeric value
| See also: | AtToken(), Token(), TokenLower(), TokenUpper() |
| Category: | CT:String manipulation , Character functions , Token functions |
| Source: | ct\token1.c |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example displays the number of tokens using different delimiters
PROCEDURE Main
LOCAL cDate := DtoC( StoD( "20061231" ) )
LOCAL cTime := Time()
LOCAL cFile := CurDrive()+ ":\" + CurDir() + "\Test.prg"
? NumToken( cDate, "/." ) // result: 3
? NumToken( cTime, ":" ) // result: 3
? NumToken( cFile, ":\." ) // result: 6
RETURN
http://www.xHarbour.com