Jan 8, 2004 #1 Oostwijk Technical User Oct 19, 2003 82 0 0 NL How can I remove the first character of a variable ?
Jan 9, 2004 #2 parkers Vendor Oct 21, 2002 157 0 0 GB Hi, This should do the trick ... $var1 = "1234567890"; $var2 = substr ($var1,1); Upvote 0 Downvote
Jan 9, 2004 #3 greadey Technical User Oct 25, 2001 231 0 0 GB I assume you mean the first letter of a string. There are a number of ways to do this (in true perl style), such as; $string = s/^[A-Za-z]{1}([A-Za-z]+)$/$1/; Assuming you have a letter in first place. or even; $string = reverse($string); chop $string; $string = reverse($string); Upvote 0 Downvote
I assume you mean the first letter of a string. There are a number of ways to do this (in true perl style), such as; $string = s/^[A-Za-z]{1}([A-Za-z]+)$/$1/; Assuming you have a letter in first place. or even; $string = reverse($string); chop $string; $string = reverse($string);
Jan 9, 2004 #4 tanderso IS-IT--Management Aug 9, 2000 981 0 0 US Code: $str =~ s/^.(.*?)$/$1/s; Sincerely, Tom Anderson Order amid Chaos, Inc. http://www.oac-design.com Upvote 0 Downvote
Code: $str =~ s/^.(.*?)$/$1/s; Sincerely, Tom Anderson Order amid Chaos, Inc. http://www.oac-design.com