public static IsPrintableString ( string str ) : bool | ||
str | string | |
return | bool |
public static bool IsPrintableString(
string str)
{
foreach (char ch in str)
{
if (ch > 0x007f)
return false;
if (char.IsLetterOrDigit(ch))
continue;
// if (char.IsPunctuation(ch))
// continue;
switch (ch)
{
case ' ':
case '\'':
case '(':
case ')':
case '+':
case '-':
case '.':
case ':':
case '=':
case '?':
case '/':
case ',':
continue;
}
return false;
}
return true;
}