Next: , Previous: toksplit, Up: Strings


4.28 unescape

replace escaped characters with their true values

Synopsis

     #include <suplib/str.h>
     
     
     
char *unescape(char *string);

Parameters

char *string
the string to unescape

Description

unescape replaces escaped characters with their true values. The escape prefix is the character ‘\’. It recognizes the following special characters: ‘\t’, ‘\n’. All other escaped characters are replaced by the character (i.e., ‘\g’ is turned into ‘g’). It makes the changes in-place.

Returns

It returns a pointer to the original string upon success, NULL if the escape prefix occurred without a character to escape.

Author

Diab Jerius