stringに全角・半角変換処理の拡張メソッドを追加する 変換処理には、WIN32APIのLCMapStringを利用してます。 static class StringUtil { // WIN32API:LCMapStringWの宣言 [DllImport("kernel32.dll")] static extern private int LCMapStringW(int Locale, uint dwMapFlags, [MarshalAs(UnmanagedType.LPWStr)]string lpSrcStr, int cchSrc, [MarshalAs(UnmanagedType.LPWStr)] string lpDestStr, int cchDest); public enum dwMapFlags : uint { NORM_IGNORECASE = 0x00000
![文字列の全角・半角変換 - Qiita](https://cdn-ak-scissors.b.st-hatena.com/image/square/b9a6fdcb9ee4d03fdc567cb4868cca0fac00cbdd/height=288;version=1;width=512/https%3A%2F%2Fqiita-user-contents.imgix.net%2Fhttps%253A%252F%252Fcdn.qiita.com%252Fassets%252Fpublic%252Farticle-ogp-background-9f5428127621718a910c8b63951390ad.png%3Fixlib%3Drb-4.0.0%26w%3D1200%26mark64%3DaHR0cHM6Ly9xaWl0YS11c2VyLWNvbnRlbnRzLmltZ2l4Lm5ldC9-dGV4dD9peGxpYj1yYi00LjAuMCZ3PTkxNiZoPTMzNiZ0eHQ9JUU2JTk2JTg3JUU1JUFEJTk3JUU1JTg4JTk3JUUzJTgxJUFFJUU1JTg1JUE4JUU4JUE3JTkyJUUzJTgzJUJCJUU1JThEJThBJUU4JUE3JTkyJUU1JUE0JTg5JUU2JThGJTlCJnR4dC1jb2xvcj0lMjMyMTIxMjEmdHh0LWZvbnQ9SGlyYWdpbm8lMjBTYW5zJTIwVzYmdHh0LXNpemU9NTYmdHh0LWNsaXA9ZWxsaXBzaXMmdHh0LWFsaWduPWxlZnQlMkN0b3Amcz0yNjdiYzI3MjUwNWViN2Y4OGY2YzAwZTRlNjIwOWNlYg%26mark-x%3D142%26mark-y%3D112%26blend64%3DaHR0cHM6Ly9xaWl0YS11c2VyLWNvbnRlbnRzLmltZ2l4Lm5ldC9-dGV4dD9peGxpYj1yYi00LjAuMCZ3PTYxNiZ0eHQ9JTQwdHJpY29naW1taWNrJnR4dC1jb2xvcj0lMjMyMTIxMjEmdHh0LWZvbnQ9SGlyYWdpbm8lMjBTYW5zJTIwVzYmdHh0LXNpemU9MzYmdHh0LWFsaWduPWxlZnQlMkN0b3Amcz04MzcxYjk5NmY5ZjA3ODI3YWYwM2M3N2EwMzVmOWU5OQ%26blend-x%3D142%26blend-y%3D491%26blend-mode%3Dnormal%26s%3Dcb45111ff3d4d44a1dbd2176c4cd0585)