Thursday, January 18, 2024

Removing ZWSP 'Zero Width Space' using VB.Net

 Sometimes user will copy in a string from a web sites.

It can contain a Zero Width Space character that will not be seen and will make your life a mess.

Pasting the string into Notepad++ 

<PLCsymbol SignalName="​.bNewAMTG_Clutch_Cal" Value="true" />

and enable show all characters you will see

<PLCsymbol SignalName="​ZWSP.bNewAMTG_Clutch_Cal" Value="true" />

The ZWSP character is UniCode Char &H200B

so

Dim CleanStr as string

CleanStr=messyStr.Replace(ChrW(&H200B), "")

This will remove any ZWSP's

No comments:

MySQL to MariaDB

 Here is a good description how to migrate to MariaDb MySQL to MariaDb Example of how to dump data from MySQL port=3307: mysqldump --user=ro...