How to add line breaks and tab characters to a string (about string processing)

Source: Internet
Author: User

When writing an SAP program, programmers often need to split the regular strings and add a newline or Tab character to the string. In other languages, you can use the ASCII code $13 $10 for insertion. an error occurred in the ABAP. To solve this problem, use the sap class cl_abap_char_utilities.
Cl_abap_char_utilities contains character constants, such as cr_lf, horizontal_tab, and newline.
The following is an example of adding carriage return to a string:

Data: CRLF (2) type C.
Data: Maid (4096) type C.
CRLF = cl_abap_char_utilities => cr_lf.
Concatenate l_html CRLF '_ function'
'30'
'Www _ get_report '> 'into l_html.

String Standard Functions

Search:Find [{First Occurrence} | {all occurrences} of] Pattern in dobj
Replace:
Replace [{First Occurrence} | {all occurrences} of] Pattern in dobj with new
Replace section [offset off] [length Len] of dobj with new
Mobile:Shift C [by N places] [mode]
Splicing:Concatenate C1... CN into C [separated by S]
Split:Split C at Del into C1... CN.
Case sensitivity conversion:Translate text to upper case.
Translate text to lower case.
String overwrite:Overlay C1 with C2 [Only STR].
Compressed string:Condense C [no-gaps].

String function of system expansion (function group CSTR)

String_length
String_concatenate
String_move_right
String_reverse
String_split
String_center
Text_split
String_split_at_position
Overlay_byte
Sjis_sbc_to_dbc
Sjis_dbc_to_sbc

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.