什么词或短语意味着"白色空间"?

时间:2015-04-28 04:38:31

标签: terminology

我目前正在编写一些处理字符串解析的C#扩展方法,我喜欢在我的方法名称中简洁而准确。

问题:是否有一个好的词或短语描述了与空白相反的东西?

要清楚,这组字符是可见的,如果在纸上打印则会消耗墨水。但我不在乎使用与墨水,纸张或印刷相关的术语,也不想采用任何特定的颜色。

VisibleCharacters似乎技术上最准确,但有点长。

NonWhiteSpace对我来说似乎是一个双重否定。我宁愿处理什么是IS,而不是它不是什么。

感谢。

2 个答案:

答案 0 :(得分:2)

我选择了#34;字形",并调用了我的函数HasGlyph。

它似乎正确涵盖了可读,可见和可打印的字符;但不是指空格或控制字符。它并不假设字符以图形方式显示或正在打印。它没有任何颜色。它还包括字母,数字和形状。

另外,它的名字也很短。

http://en.wikipedia.org/wiki/Glyph

如果你有点好奇,我的扩展方法:

public static bool HasGlyph(this string value)
{
    if (string.IsNullOrWhitespace(value)) return false;
    // TODO: Not 100% sure if the opposite of the IsNullOrWhitespace method covers what I want, but its good enough until I find out otherwise.
    return true;
}

答案 1 :(得分:0)

根据您在Unix手册(man isspace)中可以找到的内容,您可以将它们称为“可打印字符”或“图形字符”:

   isspace()
          checks for white-space characters.  In the "C" and "POSIX" locales,
          these are: space, form-feed ('\f'), newline ('\n'), carriage return ('\r'),
          horizontal tab ('\t'), and vertical tab ('\v').

   isgraph()
          checks for any printable character except space.
相关问题