Function CDM_SplitString


Definition:#include <CDM.h>
Prototype:Tcl_Obj * CDM_SplitString(char *string, char *splitChars, int allowEmptyElements);
Arguments:

string: The string to be split. (char *)
splitChars: A string containing the split characters. Defaults to " \n\t\r". (char *)
allowEmptyElements: An integer flag. (int)

C/C++ API Sections
Tcl API Sections
Description
Return Value
Notes
See Also
Index

Description:

This function will returns a list object (of type Tcl_Obj *) created by splitting string at each character that is in the splitChars argument. Each element of the result list will consist of the characters from string that lie between instances of the characters in splitChars. Empty list elements will be generated if string contains adjacent characters in splitChars, or if the first or last character of string is in splitChars. If splitChars is an empty string then each character of string becomes a separate element of the result list. SplitChars defaults to the standard white-space characters.

The last argument, allowEmptyElements is a boolean flag that controls whether the resulting list object is allowed to contain empty elements or not. If

Return Value:

This function creates and returns a newly created list object (of type Tcl_Obj *). The caller is responsible to free this object through either Tcl_DecrRefCount or CDM_Free.

In case of an NULL will be returned and an error message will be left at the current active Tcl interpreter (CDM_Interp).

Notes:

This function is equivalent to the "split" Tcl command.

See Also:

CDM_Free, Tcl_DecrRefCount, split


Generated by: petasis@aias on Wed Aug 16 10:31:57 PM EEST 2006.