Next: , Previous: str_prune, Up: Strings   [Contents]


4.4 str_rep

replaces all occurances of a character in a string with another

Synopsis

#include <suplib/str.h>

char *str_rep(
  char *str,
  int c_old,
  int c_new
);

Parameters

char *str

the string to scan

int c_old

the character to be replaced

int c_new

the character to be inserted

Description

str_rep scans a string, replacing every occurance of a the specified character with another.

Returns

It returns the pointer to the string which was passed.

Author

Diab Jerius