文字列から英字を検索し、最初に検索された文字の位置を返します。
| カテゴリ: | 文字 |
| 制限事項: | この関数は、I18Nレベル1に準拠しています。英語以外の言語を使用する場合、可能な限りI18Nレベル1の関数の使用は避けてください。特定の環境下では、I18Nレベル1の関数は、2バイト文字セット(DBCS)または複数バイト文字セット(MBCS)エンコーディングを使用すると正常に動作しない場合があります。 |
data _null_;
string='Next = _n_ + 12E3;';
j=0;
do until(j=0);
j=anyalpha(string, j+1);
if j=0 then put +3 "That's all";
else do;
c=substr(string, j, 1);
put +3 j= c=;
end;
end;
run;j=1 c=N j=2 c=e j=3 c=x j=4 c=t j=9 c=n j=16 c=E That's all
data test; do dec=0 to 255; byte=byte(dec); hex=put(dec, hex2.); anyalpha=anyalpha(byte); output; end; proc print data=test; run;