| 572 * @return The string with carriage returns. |
572 * @return The string with carriage returns. |
| 573 */ |
573 */ |
| 574 char *gaim_str_add_cr(const char *str); |
574 char *gaim_str_add_cr(const char *str); |
| 575 |
575 |
| 576 /** |
576 /** |
| 577 * Strips all carriage returns from a string. |
577 * Strips all instances of the given character from the |
| 578 * |
578 * given string. The string is modified in place. This |
| 579 * @param str The string to strip carriage returns from. |
579 * is useful for stripping new line characters, for example. |
| 580 */ |
580 * |
| 581 void gaim_str_strip_cr(char *str); |
581 * Example usage: |
| |
582 * gaim_str_strip_char(my_dumb_string, '\n'); |
| |
583 * |
| |
584 * @param str The string to strip characters from. |
| |
585 * @param thechar The character to strip from the given string. |
| |
586 */ |
| |
587 void gaim_str_strip_char(char *str, char thechar); |
| |
588 |
| |
589 /** |
| |
590 * Given a string, this replaces all instances of one character |
| |
591 * with another. This happens inline (the original string IS |
| |
592 * modified). |
| |
593 * |
| |
594 * @param string The string from which to replace stuff. |
| |
595 * @param delimiter The character you want replaced. |
| |
596 * @param replacement The character you want inserted in place |
| |
597 * of the delimiting character. |
| |
598 */ |
| |
599 void gaim_util_chrreplace(char *string, char delimiter, |
| |
600 char replacement); |
| 582 |
601 |
| 583 /** |
602 /** |
| 584 * Given a string, this replaces one substring with another |
603 * Given a string, this replaces one substring with another |
| 585 * and returns a newly allocated string. |
604 * and returns a newly allocated string. |
| 586 * |
605 * |