Mercurial > hg > ishara
annotate general/endswith.m @ 61:eff6bddf82e3 tip
Finally implemented perceptual brightness thing.
author | samer |
---|---|
date | Sun, 11 Oct 2015 10:20:42 +0100 |
parents | e44f49929e56 |
children |
rev | line source |
---|---|
samer@4 | 1 function b=endswith(str,suffix) |
samer@4 | 2 % endswith - test to see if a string ends with a certain suffix |
samer@4 | 3 % |
samer@4 | 4 % endswith :: string ~'string to check', string ~'suffix' -> bool. |
samer@4 | 5 % |
samer@4 | 6 % returns 1 iff end of string matches suffix (case insensitive) |
samer@4 | 7 |
samer@4 | 8 if length(str)<length(suffix) b=0; else |
samer@4 | 9 b=strcmpi(str(end-length(suffix)+1:end),suffix); |
samer@4 | 10 end |
samer@4 | 11 |
samer@4 | 12 |