SDDSlib
|
Implements the strslide function. More...
#include "mdb.h"
Go to the source code of this file.
Functions | |
char * | strslide (char *s, long distance) |
Slides character data within a string by a specified distance. | |
Implements the strslide function.
Definition in file strslide.c.
char * strslide | ( | char * | s, |
long | distance ) |
Slides character data within a string by a specified distance.
This function shifts the characters in the string s
by the given distance
. A positive distance slides characters toward higher indices (to the right), while a negative distance slides characters toward lower indices (to the left).
s | Pointer to the null-terminated string to be modified. |
distance | The number of positions to slide the string. Positive values shift characters to the right, and negative values shift characters to the left. |
s
on success. Returns NULL
if the distance is greater than the string length when sliding to higher indices. Definition at line 32 of file strslide.c.