Hi all, I have a need to strip some characters from a variable to get the right data but have only found how to strip all but the last or middle stuff, need to keep the beginning. EG: With $(SIPURI) I want to keep just the sip number and delete the remainder '@server.com'. Ideally I'd like to use 'SayDigits($(sipuri[-@server.com])' All replies greatfully accepted. Phil --------------------------------------------------------------------- To unsubscribe, e-mail: asterisk-perl-unsubscribe@lists.gnuinter.net For additional commands, e-mail: asterisk-perl-help@lists.gnuinter.net
van Leen, Phil wrote:> EG: > With $(SIPURI) I want to keep just the sip number and delete the remainder > '@server.com'. > > Ideally I'd like to use 'SayDigits($(sipuri[-@server.com])'Maybe Set(without_host=CUT(${SIPURI},@,1)) ? Regards, Philipp -- amooma GmbH - Bachstr. 126 - 56566 Neuwied - http://www.amooma.de Let's use IT to solve problems and not to create new ones. Asterisk? -> http://www.das-asterisk-buch.de Gesch?ftsf?hrer: Stefan Wintermeyer Handelsregister: Neuwied B 14998
>From: "van Leen, Phil" <pvanleen@nontaurus.com> >Date: Fri, 30 Mar 2007 11:52:34 +0800 > >Hi all, > >I have a need to strip some characters from a variable to get the right >data >but have only found how to strip all but the last or middle stuff, need to >keep the beginning. > >EG: >With $(SIPURI) I want to keep just the sip number and delete the remainder >'@server.com'. > >Ideally I'd like to use 'SayDigits($(sipuri[-@server.com])'You can certainy use CUT(), or regular expression. Yuan Liu>All replies greatfully accepted. > >Phil