,chr(0x41).prt;
D:\sample\lib>adp chr.p A
,ascii('A').prt;
D:\sample\lib>adp ascii.p 65
,$a = { 10, 'aa', 'b"b' }, csv($a, 'AA', $r), $r.prtn;
D:\sample\lib>adp csv.p 10,aa,"b""b",AA
書式記号 | 説明 |
---|---|
%a | 週(英略記) Sun, Mon, Tue, Wed, Thu, Fri, Sat |
%b | 月(英略記) Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec |
%d | 日 01~31 |
%H | 時間 00~24 |
%m | 月(数字)01~12 |
%M | 分 00~59 |
%S | 秒 00~59 |
%w | 週(数字) 0~6 |
%Y | 年 0000~9999 |
%% | %自身を表す |
,$t == 'Sat, 21 May 2011 14:58:41 +0000'
,$inp_fmt == '%a, %d %b %Y %H:%M:%S'
,$out_fmt == '%Y-%m-%d %H:%M:%S'
,ctimestr( $t, $inp_fmt, $out_fmt).prtn;
D:\sample\lib>adp ctimestr.p
2011-05-21 14:58:41
,now.ctimestr('%a %b %d %H:%M:%S %Y', '%Y-%m-%d %H:%M:%S').prtn;
2020-11-05 16:23:54
,dbl('10.5').prtn; ,dbl(20.3).prtn;
D:\sample\lib>adp dbl.p 10.500000 20.300000
,int('100').prtn; ,int(30.3).prtn;
D:\sample\lib>adp int.p 100 30
,rsort({ "z", "d", "a", "b", "f"},$dst), prtn($dst);
>adp rsort1.p {z, f, d, b, a}
,$src == {{ 'col1' => 20, 'col2' => 'test5' }, { 'col1' => 100, 'col2' => 'test2' }, { 'col1' => 5, 'col2' => 'test3' }, { 'col1' => 20, 'col2' => 'test4' }} ,rsort( $src, {'col2', 'col1'}, $dst), prtn($dst);
>adp rsort2.p {{col1 => 20, col2 => test5}, {col1 => 20, col2 => test4}, {col1 => 5, col2 => test3}, {col1 => 100, col2 => test2}}
,file('sha1.p').sha1.prt;
D:\sample\lib>adp sha1.p D62745C8425675EE054CFA89D982DC746CF4E062
,sort({ "z", "d", "a", "b", "f"},$dst), prtn($dst);
>adp sort1.p {a, b, d, f, z}
,$src == {{ 'col1' => 20, 'col2' => 'test5' }, { 'col1' => 100, 'col2' => 'test2' }, { 'col1' => 5, 'col2' => 'test3' }, { 'col1' => 20, 'col2' => 'test4' }} ,sort( $src, {'col2', 'col1'}, $dst), prtn($dst);
>adp sort2.p {{col1 => 100, col2 => test2}, {col1 => 5, col2 => test3}, {col1 => 20, col2 => test4}, {col1 => 20, col2 => test5}}
,urldecode('%93%FA%96%7B%8C%EA%95%B6%8E%9A%97%F1%81iShift-JIS%81j').prtn;
D:\sample\lib>adp urldecode.p 日本語文字列(Shift-JIS)
,urlencode('日本語文字列(Shift-JIS)').prtn;
D:\sample\lib>adp urlencode.p %93%FA%96%7B%8C%EA%95%B6%8E%9A%97%F1%81iShift-JIS%81j