这里所说的扩展是:
例如 “-a-c-f” —-> “abcdef”
void str_expand(char *dest_str, const char *src_str)
{
if(dest_str == NULL || src_str == NULL)
{
return ;
}
char *dest = dest_str;
const char *src = src_str;
int i = 0;
int j = 0;
while((get_c = src[i++]) != '\0')
{
if(src[i] == '-' && src[i+1] > get_c)
{
dest[j++] = get_c++;
}
else
{
dest[j++] = get_c;
}
}
dest[j] = '\0';
}