alphanumeric - finding one less!
Posted on 2002-05-08
I need some help to chamge the end character in a string of letters to the character or number which is one less based on alphanumeric characters and maintaining case
example string 1 - " /YEZ/NOZ1/B2FREE/fixed "
example string 2 - " /YEZ/NOZ1/B2FRE3/fixed "
I want to become
example string 1 - " /YEZ/NOZ1/B2FRED/fixed "
example string 2 - " /YEZ/NOZ1/B2FRE2/fixed "
I have tried using "$string =~ s/$end/$end -1/"
but it doesn't work becase it is not a number and sometimes it finishes with "a letter/fixed" sometimes "a number/fixed"
"fixed" is the known string which is always constant...
"/APHANUM/APHANUM/APHANUM/" is the dynamic bit and it is always the character before "/fixed" that I need to be one less...
Can anyone tell me how to do it?