- 保留空白值在字符串的长度。
DATA lv_char1 TYPE string VALUE 'Hello'.
DATA lv_char2 TYPE string VALUE 'World'.
DATA LV_CHAR3 TYPE C LENGTH 50.
DATA(lv_string3) = |{ lv_char1 } { lv_char2 }!|.
WRITE: / lv_string3.
DATA(lv_string2) = lv_char1 && | { lv_char3 } | && lv_char2 && '!' .
WRITE: / lv_string2.
CONCATENATE lv_char1 lv_char3 lv_char2 '!' INTO DATA(lv_string4) RESPECTING BLANKS.
WRITE: / lv_string4.
2. 替换字符串
DATA: lv_search TYPE String VALUE 'hello world',
lv_palceholder TYPE String.
DATA lv_length TYPE I.
lv_length = strlen( lv_search ).
do lv_length times.
CONCATENATE '%' lv_palceholder INTO lv_palceholder.
enddo.
WRITE: / lv_palceholder.
OVERLAY lv_search WITH lv_palceholder.
WRITE: / lv_search.
其他字符串操作见
https://www.cnblogs.com/zt11402/p/16951621.html
https://www.cnblogs.com/mingdashu/p/string_split.html