导航

字符串中 加入 空格

Posted on 2010-07-21 14:21  Hahappyppy  阅读(235)  评论(0编辑  收藏  举报

4.6C的帮助:
For the highlighted argument positions of the following ABAP statements, blank characters at the end of strings are not taken into account. This may change in the next release.
-----
7.0的帮助:
In contrast to text fields, trailing blanks are always taken into account in text strings. There is a specific string literal for text strings.
----
Changes in Release 6.10:
Modification 6
Introduction of string literals
String literals are enclosed by grave accents (`)of the form str = `ABC`. String literals are of data type STRING and trailing spaces are taken into account, as opposed to text literals.
data: STR1 type string value 'ABC  ',
      STR2 type string value `ABC  `,
      CNT1 type i,
      CNT2 type i.
CNT1 = strlen( STR1 ).
CNT2 = strlen( STR2 ).
write: / CNT1, CNT2.
The length for the string STR1 will be CNT1 = 3 and for the string STR2 it will be CNT2 = 5.