On Fri, 18 Jun 2004 16:34:38 -0400, JJB <[EMAIL PROTECTED]> wrote: > > I have $email field that sometimes may not end with alpha character. > > How would I code if (last position of $email != alpha) { replace > last pos of $email with blank } > > Or any other coding method to strip off non alpha from $email field > if present. > > Thanks > > _______________________________________________ > [EMAIL PROTECTED] mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "[EMAIL PROTECTED]" >
Something along the lines of: my @foo = split( //, $email ); and then do one of these, pop @foo unless $foo[-1] =~ /[a-zA-Z]/; or to really want to replace it with a space, $foo[-1] =~ " " unless $foo[-1] =~ /[a-zA-Z] -- Andy Harrison _______________________________________________ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"