ITPub博客

首页 > 应用开发 > IT综合 > 使用concatenate連接時,字串類型(String)要比字符類型(C)快

使用concatenate連接時,字串類型(String)要比字符類型(C)快

原创 IT综合 作者:tolyhuang 时间:2007-12-07 10:59:29 0 删除 编辑

Character and String Manipulation:

Depending on the length of the character field,
string operation may be faster.
The concatenate algorithm has to compute the length of
the fixed character fields by scanning the first
non-blank character from the end.

[@more@]

data string1 type string.
data string2 type string.
data string3 type string.

string1 = 'mysap'.
string2 = '.com'.
concatenate string1 string2 into string3.

以上代碼的速度要比下面的代碼快:

data c1(200) type c.
data c2(200) type c.
data c3(400) type c.

c1 = 'mysap'.
c2 = '.com'.
concatenate c1 c2 into c3.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9437124/viewspace-989431/,如需转载,请注明出处,否则将追究法律责任。

上一篇: C與I類型的比較
请登录后发表评论 登录
全部评论

注册时间:2010-07-22

  • 博文量
    268
  • 访问量
    1413841