‎2009 Feb 11 11:39 AM
Hi Guys,
I have a Text as "ABCDEFGH"
I need to remove the Quotes ( " ) at the start and the end.
Kindly help.
Thanks and regards,
Frank
‎2009 Feb 11 11:42 AM
calculate the length of the string forst.
here in ur eg it is 10.
v_length = STRLEN( v_text )
v_next = 0.
v_count = 0.
DO v_length TIMES.
if v_text+v_next(v_length) = ' " '.
REPLACE ' " ' in v_text with ' ' into v_text.
ENDIF.
ENDDO.
v_text will hve value without ".
OR REPLACE ALL OCCURENCES OF ' " ' IN V_TEXT WITH ' ' INTO V_TEXT.
Edited by: Kalyan Chakravarthi on Feb 11, 2009 12:43 PM
Edited by: Kalyan Chakravarthi on Feb 11, 2009 12:47 PM
‎2009 Feb 11 11:42 AM
calculate the length of the string forst.
here in ur eg it is 10.
v_length = STRLEN( v_text )
v_next = 0.
v_count = 0.
DO v_length TIMES.
if v_text+v_next(v_length) = ' " '.
REPLACE ' " ' in v_text with ' ' into v_text.
ENDIF.
ENDDO.
v_text will hve value without ".
OR REPLACE ALL OCCURENCES OF ' " ' IN V_TEXT WITH ' ' INTO V_TEXT.
Edited by: Kalyan Chakravarthi on Feb 11, 2009 12:43 PM
Edited by: Kalyan Chakravarthi on Feb 11, 2009 12:47 PM
‎2009 Feb 11 11:44 AM
‎2009 Feb 11 11:46 AM
Hi,
Use this:
data: v_char type string value '"ABCDF"'.
REPLACE ALL OCCURRENCES OF '"' IN v_char with space.
condense v_char.
WRITE:/ V_CHAR.thanks\
Mahesh
‎2009 Feb 11 11:47 AM
hi....
go with following code.
if w_obj has the text "ABCDEFGH"
data: w_i type i,
w_char type string.
w_i = strlen( w_obj ).
w_i = w_i - 1.
w_char = w_obj+1(w_i).
write: w_char.
Regard
‎2009 Feb 11 11:52 AM
Hi Frank,
Try the following code:
DATA: v_str TYPE string VALUE '"ABCDFGH"'.
REPLACE ALL OCCURRENCES OF '"' IN v_str WITH space.
CONDENSE v_char.
Hope this will help.
Regards,
Nitin.
‎2009 Feb 11 11:52 AM
Hi,
It is very simple.there are 2 approach for doing this:
1.
data:l_string(10) type c,
l_string1(8) type c.
l_string = '"ABCDEFGH"'.
l_string1 = l_string+1(8). "this will read l_string A till H into l_string1
write: l_string1.OR
2.
data:l_string(10) type c,
l_string1(8) type c,
l_len type i,
counter type i.
l_string = '"ABCDEFGH"'.
l_len = strlen(l_string).
l_string1 = l_string+1(l_len -1). "this will read l_string A till H into l_string1Hope this might help you.
Pooja
Edited by: Pooja Gupta on Feb 11, 2009 12:53 PM
‎2009 Feb 11 12:26 PM
hi...
you can also go with...
data: w_char type string value '"ABCDEFGH"'.
REPLACE ALL OCCURRENCES OF '"' IN w_char with space.
condense w_char.
WRITE:/ W_CHAR.
regards