3種類のスペースユニコード( u00A0、 u0020、 u3000)



Three Kinds Space Unicode U00a0



このプロジェクトは、顧客が使用できるExcelのインポート注文機能を提供し、ツールクラスのスペースを自動的に削除するメソッドがあります。しかし、奇妙なことに、失敗したバーコードスペースフィルターがあることが判明しました。
URL https://www.sojson.com/ascii.htmlにバーコードを配置し、ASCIIコードを変換して検索します
画像
u00a0はUnicodeエンコーディングに属している必要があります。スペースは r nなどに置き換えることはできず、次の方法で置き換えることができます。

dest = dest.replaceAll('[\pZ]', '')

次のリファレンス



The lowercase p in pP means property, which means a Unicode property, and is used as a prefix for Unicode regular expressions. The uppercase P represents one of the seven character attributes of the Unicode character set: the punctuation character. The other six are L: letter M: mark symbol (generally not appear alone) Z: separator (such as space, newline, etc.) S: Symbols (such as mathematical symbols, currency symbols, etc.) N: Numbers (such as Arabic numerals, Roman numerals, etc.) 1. Non-breaking space u00A0, mainly used in office, so that a word will not be displayed in a new line at the end, the shortcut key ctrl+shift+space 2. Half-width spaces(English symbols)u0020, commonly used in code 3. Full-width spaces(Chinese symbols)u3000, used in Chinese articles