[OpenSIPS-Users] remove trailing white space

Liviu Chircu liviu at opensips.org
Tue Nov 11 19:07:56 CET 2014


Hello Jeff,

You could do something like:

...
loadmodule "avpops.so"
...
startup_route
{
     $var(str) = "foofoo      ";
     $avp(str) = $var(str);
     avp_subst("$avp(str)", "/([^ ]*) *$/\1/");
     xlog("Replacement for '$var(str)' is '$avp(str)'\n");
}

Best regards,

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 11/11/2014 06:54 PM, Jeff Pyle wrote:
> Hello,
>
> How might one remove trailing white space from a script variable or 
> avp from within the OpenSIPS script?
>
>
>
> - Jeff
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20141111/6ffd4f1a/attachment.htm>


More information about the Users mailing list