‎2008 Jul 15 7:00 AM
How can i get substring from main string.
ex:mainstr = 'abcdefgh'.
i want sting excluding 'abc'.
‎2008 Jul 15 7:01 AM
hi,
str = mainstr+3.
or replace 'abc' in mainstr with ''.
Regards,
Subramanian
‎2008 Jul 15 7:01 AM
‎2008 Jul 15 7:01 AM
‎2008 Jul 15 7:03 AM
Hi Venkat,
if mainstr = 'abcdefgh'.
then mainstr+4(5) will give you the value 'defgh'.
Regards,
Asha
‎2008 Jul 15 7:04 AM
Hi,
Write----
str = mainstr+3(5).
str is substring.
Regards,
Sujit
‎2008 Jul 15 7:08 AM
Hi,
use the concept of offset
str = mainstr+2(5).
Regards,
Anirban
‎2008 Jul 15 7:08 AM
Hi,
You can use the offset position and length of the string function
mainstr+offset(length)
in your case... you can use
string1 = mainstr+3.
It starts from 3rd offset position till the end of the string
if you want to specify the length you can also do that...
starting from 3 position you want to retrieve 3 chars then specify the length also
mainstr+3(3)
regards
padma
‎2008 Jul 15 7:10 AM
hiii
you can get this value by using OFFSTE like
mainstr = 'abcdefgh'.
w_answer = mainstr+3(5).
or use like
mainstr CN 'abc'.
regards
twinkal
‎2008 Jul 15 7:27 AM
hi
go through this
mainstr = 'abcdefgh'.
ex_srting = 'abc'now get the length of ex_string. here it is 3
so length1 = 3.
lenght2 = 8
now use this
mainstr CS ex_string
If the result of the comparison is positive, the system field SY-FDPOS contains the offset of the first character of ex_string in mainstr.
offset = SY-FDPOS + length1.
req_len = length - offset
req_str = mainstr+offset(req_len ).Cheers
Snehi