I before E except after C: Difference between revisions

Content deleted Content added
m →‎{{header|REXX}}: removed some dead code. -- ~~~~
m →‎{{header|REXX}}: handled the case if word starting with subject string simplier. -- ~~~~
Line 80: Line 80:
ei=pos('EI',u); ie=pos('IE',u) /*see if EI or IE is in this word*/
ei=pos('EI',u); ie=pos('IE',u) /*see if EI or IE is in this word*/
if ie\==0 & ei\==0 then #.eiie=#.eiie+1 /*word contains both IE & EI*/
if ie\==0 & ei\==0 then #.eiie=#.eiie+1 /*word contains both IE & EI*/
if ie\==0 then if substr(u,ie-1+(ie==1)*999, 1)=='C' then #.iec=#.iec+1

else #.iex=#.iex+1
if ie\==0 then do; if ie==1 then ie=999 /*word starts with: IExxx */
if substr(u,ie-1, 1)=='C' then #.iec=#.iec+1
if ei\==0 then if substr(u,ei-1+(ei==1)*999, 1)=='C' then #.eic=#.eic+1
else #.iex=#.iex+1
else #.eix=#.eix+1
end
if ei\==0 then do; if ei==1 then ei=999 /*word starts with: EIxxx */
if substr(u,ei-1, 1)=='C' then #.eic=#.eic+1
else #.eix=#.eix+1
end
end /*r*/
end /*r*/