LeftStr函数使用

LeftStr(s, i);

表示返回字符串s的左边共I位字符的一个新字符串。

var
    i: integer;
    s: string;
    result: string;
begin
    i := 3;
    s := 'abcd1234';
    result := LeftStr(s, i);  // abc
end;
    s := '这是测试';
    result := LeftStr(s, 3);  // 这是测

 

posted @ 2015-10-12 17:04  王云盼  阅读(1239)  评论(0编辑  收藏  举报