2023 Feb 16 4:32 PM
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.
2023 Feb 16 4:58 PM
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
2023 Feb 16 4:58 PM
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
2023 Feb 16 5:16 PM
Hi Ravi,
Please try to use replace regular expression.
REPLACE_REGEXPR Function (String) | SAP Help Portal
Pavan