Posted By

qrist0ph on 11/16/09


Tagged

abap


Versions (?)

ABAP String processing


 / Published in: Other
 

  1. Data: foo TYPE string,
  2. result1 TYPE string,
  3. result2 TYPE string.
  4. foo = '---'.
  5. REPLACE '-' in foo WITH '+'.
  6. MESSAGE foo TYPE 'I'.
  7.  
  8. "Zusammensetzen
  9. CONCATENATE 'foo' 'bar' '2' into foo.
  10. MESSAGE foo TYPE 'I'.
  11.  
  12. "Splitten
  13. SPLIT foo AT 'o' into result1 result2.
  14. "MESSAGE result2 TYPE 'I'.
  15.  
  16. DATA temp_tab TYPE TABLE OF string.
  17. SPLIT foo AT 'o' INTO TABLE temp_tab.
  18. CONCATENATE LINES OF temp_tab INTO foo.
  19. "MESSAGE foo TYPE 'I'.
  20.  
  21. "Suchen
  22. DATA result_tab TYPE match_result_tab.
  23. DATA regexp TYPE string VALUE 'a+b'.
  24. FIND ALL OCCURRENCES OF REGEX regexp IN 'aaaabnnnaaab' IGNORING CASE RESULTS result_tab.
  25. CONCATENATE LINES OF result_tab INTO foo.
  26. MESSAGE foo TYPE 'I'.

Report this snippet  

You need to login to post a comment.