mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-14 09:58:17 +00:00
add regex api func
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6193 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -223,6 +223,26 @@ SWITCH_DECLARE(switch_bool_t) switch_is_lan_addr(const char *ip)
|
||||
}
|
||||
|
||||
|
||||
SWITCH_DECLARE(char *) switch_replace_char(char *str, char from, char to, switch_bool_t dup)
|
||||
{
|
||||
char *p;
|
||||
|
||||
if (dup) {
|
||||
p = strdup(str);
|
||||
assert(p);
|
||||
} else {
|
||||
p = str;
|
||||
}
|
||||
|
||||
for(;p && *p; p++) {
|
||||
if (*p == from) {
|
||||
*p = to;
|
||||
}
|
||||
}
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(char *) switch_strip_spaces(const char *str)
|
||||
{
|
||||
const char *sp = str;
|
||||
|
Reference in New Issue
Block a user