microsoft / cal-open-library

C/AL Open Library is a repository for .NET Interop wrappers that will be included into Dynamics 365 for Financials and usable from Extensions V2
MIT License
86 stars 52 forks source link

New functions for Codeunit 10 to add RegularExpression.Replace #28

Closed megel closed 6 years ago

megel commented 6 years ago

For the request RegEx.Replace from Microsoft/AL #266

Introduction of Regular Expression Replace in Codeunit Type Helper 10:

[External] RegexReplace(StringToReplace : Text;Pattern : Text;NewValue : Text) : Text
Regex := Regex.Regex(Pattern);
NewString := Regex.Replace(StringToReplace,NewValue);
EXIT(NewString);

[External] RegexReplaceIgnoreCase(StringToReplace : Text;Pattern : Text;NewValue : Text) : Text
Regex := Regex.Regex(Pattern,RegexOptions.IgnoreCase);
NewString := Regex.Replace(StringToReplace,NewValue);
EXIT(NewString);
megel commented 6 years ago

Added the Pull Request #29

JesperSchulz commented 6 years ago

Thank you for your pull request contribution! We will look into it right away.