Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Remove Leading Numbers in a String in CDS View

former_member797594
Discoverer
0 Kudos
4,312

Hi,

I have a requirement to remove leading numbers in a string in CDS View. LTRIM could be the ideal solution if i have to remove a single character, but in my case i have to remove a set of characters(numbers) at the beginning of a string.

For EX:

In the string '123Material456' I have to remove the leading 123 and the result should be 'Material456'.

Any idea on how to achieve this in a string in CDS View? I tried searching in the forum but could not get an ideal solution.

Any help is much appreciated.

Regards,

Ravi.

1 ACCEPTED SOLUTION

Ryan-Crosby
Active Contributor
4,047

Hi Ravi,

If this highlighted function works like a regular expression to find any matches or like CA in ABAP, then you should be able to use it in conjunction with substring as the pos argument to meet your requirement.

Regards,

Ryan Crosby

2 REPLIES 2

Ryan-Crosby
Active Contributor
4,048

Hi Ravi,

If this highlighted function works like a regular expression to find any matches or like CA in ABAP, then you should be able to use it in conjunction with substring as the pos argument to meet your requirement.

Regards,

Ryan Crosby

j_pavan_kumar
Product and Topic Expert
Product and Topic Expert
4,047

Hi Ravi,

Please try to use replace regular expression.

REPLACE_REGEXPR Function (String) | SAP Help Portal

Thanks,

Pavan