Anonymous user
Extract file extension: Difference between revisions
m
→{{header|REXX}}: changed comments and whitespace.
(make one test-case use a number and upper-case letter) |
m (→{{header|REXX}}: changed comments and whitespace.) |
||
Line 1,005:
do j=1 while @.j\==''; x= /*process (all of) the file name(s). */
p=lastpos(., @.j)
if p\==0 then x=substr(@.j, p+1) /*Found a dot? Then get stuff after it*/
if \datatype(x, 'A') then x= /*
if x=='' then x= " [null]" /*use a better name for a "null"
else x= . || x /*prefix the extension with a period.
say 'file extension=' left(x, 20) "for file name=" @.j
end /*j*/ /*stick a fork in it, we're all done. */</lang>
'''output''' when using the default (internal) inputs:
|