Dynamics 365 Business Central: How to quickly remove Non-Alphanumeric Characters in AL

Dynamics 365 Business Central

Hi, Readers.
When working with data imports, API integrations, or customer records in Dynamics 365 Business Central, we often encounter strings with unwanted symbols, spaces, or special characters. We previously discussed a similar topic, but at that time, we solved it using a custom method.

Recently, I came across a built-in standard method that handles this much better. In this post, I’d like to share how you can easily remove non-alphanumeric characters in AL code—leaving only clean letters (A–Z) and numbers (0–9) for your Business Central solution.
To achieve this, we can use the standard codeunit 47 StringConversionManagement:

procedure RemoveNonAlphaNumericCharacters:

Here is a quick AL code example showing how it works:

Test video:

Test code:

Very simple, give it a try!!!😁

PS: How to quickly remove white-space characters from the current Text/String (leading, trailing and all) in AL

END

Hope this will help.

Thanks for your reading.

ZHU

コメント

Copied title and URL