next up previous 264
Next: astChrSplitRE - Extract sub-strings matching a specified regular expression
Up: AST Memory Management and Utility Functions
Previous: astChrSplit - Extract words from a supplied string


astChrSplitC - Split a string using a specified character delimiter

Description:
This function extracts all sub-strings separated by a given character from the supplied string and returns them in an array of dynamically allocated strings. The delimiter character itself is not included in the returned strings.

Delimiter characters that are preceeded by "$\backslash$" are not used as delimiters but are included in the returned word instead (without the "$\backslash$").

Synopsis:
char $*$$*$astChrSplitC( const char $*$str, char c, int $*$n )
Parameters:
str
Pointer to the string to be split.
c
The delimiter character.
n
Address of an int in which to return the number of words returned.
Returned Value:
astChrSplitC()
A pointer to a dynamically allocated array containing "$*$n" elements. Each element is a pointer to a dynamically allocated character string containing a word extracted from the supplied string.
Notes:
  • A NULL pointer is returned if this function is invoked with the global error status set or if it should fail for any reason, or if the supplied string contains no words.


next up previous 264
Next: astChrSplitRE - Extract sub-strings matching a specified regular expression
Up: AST Memory Management and Utility Functions
Previous: astChrSplit - Extract words from a supplied string

AST A Library for Handling World Coordinate Systems in Astronomy
Starlink User Note 211
R.F. Warren-Smith & D.S. Berry
24th May 2011
E-mail:ussc@star.rl.ac.uk

Copyright (C) 2009 Science \& Technology Facilities Council