Next: Text Output Up: Programming Utilities Previous: Progress Reports

Strings

Some simple string manipulation techniques are provided:


public  BOOLEAN  string_ends_in(
    char   string[],
    char   ending[] )

Determines if the string ends in the specified ending. For instance, passing the arguments, "rainfall" and "fall" returns TRUE.


public    void   strip_outer_blanks(
    char  str[],
    char  stripped[] )

Removes leading and trailing blanks from the string, placing the result in the argument stripped. Correctly handles case where the two string arguments point to the same memory.


public  void  get_upper_case_string(
    char    string[],
    char    upper_case[] )

Converts the string to an all upper case string. Correctly handles case where the two string arguments point to the same memory.


public  int  find_character(
    char    string[],
    char    ch )

Searches for the given character in the given string returning the index where it was found, or -1 if it was not found.


public  BOOLEAN  blank_string(
    char   string[] )

Returns true if the string is empty or consists of only space, tab, and newline characters.



Next: Text Output Up: Programming Utilities Previous: Progress Reports


david@pet.mni.mcgill.ca
Fri Feb 17 15:37:42 EST 1995