in reply to Case-sensitive substitution with case-insensitive matches
$1 & (' ' x length $1) returns a string containing nulls and spaces. Each uppercase character in $1 produces a null in the string, and each lowercase character produces a space.
Or-ing that with 'SAD' turns on the "lowercase bit" for each letter in 'SAD' that lines up with a space in our string. The characters that line up with nulls are unchanged.
So, effectively, this copies all the lowercase bits from $1 to 'SAD'.
This is hard for me to explain, please let me know if it's not clear.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(Ovid) Re: Re: Case-sensitive substitution with case-insensitive matches
by Ovid (Cardinal) on Dec 02, 2000 at 05:05 UTC |