Created
March 8, 2014 06:59
-
-
Save baba-s/9426561 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static partial class StringExtensions | |
| { | |
| /// <summary> | |
| /// 1バイト文字で構成された文字列かどうかを確認します | |
| /// </summary> | |
| /// <param name="str">確認対象の文字列</param> | |
| /// <returns>1バイト文字のみで構成された文字列の場合 true</returns> | |
| public static bool IsOneByteStr(string str) | |
| { | |
| var bytes = System.Text.Encoding.GetEncoding(932).GetBytes(str); | |
| return bytes.Length == str.Length; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment