📄 glib-unicode-manipulation.html
字号:
<a name="id2971431"></a><h3><a name="g-unichar-iscntrl"></a>g_unichar_iscntrl ()</h3><a class="indexterm" name="id2971442"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a> g_unichar_iscntrl (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);</pre><p>Determines whether a character is a control character.Given some UTF-8 text, obtain a character value with<a href="glib-Unicode-Manipulation.html#g-utf8-get-char"><code class="function">g_utf8_get_char()</code></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>c</code></em> :</span></td><td> a Unicode character</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <code class="literal">TRUE</code> if <em class="parameter"><code>c</code></em> is a control character</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2971525"></a><h3><a name="g-unichar-isdigit"></a>g_unichar_isdigit ()</h3><a class="indexterm" name="id2971536"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a> g_unichar_isdigit (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);</pre><p>Determines whether a character is numeric (i.e. a digit). Thiscovers ASCII 0-9 and also digits in other languages/scripts. Givensome UTF-8 text, obtain a character value with <a href="glib-Unicode-Manipulation.html#g-utf8-get-char"><code class="function">g_utf8_get_char()</code></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>c</code></em> :</span></td><td> a Unicode character</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <code class="literal">TRUE</code> if <em class="parameter"><code>c</code></em> is a digit</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2971621"></a><h3><a name="g-unichar-isgraph"></a>g_unichar_isgraph ()</h3><a class="indexterm" name="id2971632"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a> g_unichar_isgraph (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);</pre><p>Determines whether a character is printable and not a space(returns <code class="literal">FALSE</code> for control characters, format characters, andspaces). <a href="glib-Unicode-Manipulation.html#g-unichar-isprint"><code class="function">g_unichar_isprint()</code></a> is similar, but returns <code class="literal">TRUE</code> forspaces. Given some UTF-8 text, obtain a character value with<a href="glib-Unicode-Manipulation.html#g-utf8-get-char"><code class="function">g_utf8_get_char()</code></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>c</code></em> :</span></td><td> a Unicode character</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <code class="literal">TRUE</code> if <em class="parameter"><code>c</code></em> is printable unless it's a space</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2971740"></a><h3><a name="g-unichar-islower"></a>g_unichar_islower ()</h3><a class="indexterm" name="id2971751"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a> g_unichar_islower (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);</pre><p>Determines whether a character is a lowercase letter.Given some UTF-8 text, obtain a character value with<a href="glib-Unicode-Manipulation.html#g-utf8-get-char"><code class="function">g_utf8_get_char()</code></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>c</code></em> :</span></td><td> a Unicode character</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <code class="literal">TRUE</code> if <em class="parameter"><code>c</code></em> is a lowercase letter</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2971834"></a><h3><a name="g-unichar-isprint"></a>g_unichar_isprint ()</h3><a class="indexterm" name="id2971846"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a> g_unichar_isprint (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);</pre><p>Determines whether a character is printable.Unlike <a href="glib-Unicode-Manipulation.html#g-unichar-isgraph"><code class="function">g_unichar_isgraph()</code></a>, returns <code class="literal">TRUE</code> for spaces.Given some UTF-8 text, obtain a character value with<a href="glib-Unicode-Manipulation.html#g-utf8-get-char"><code class="function">g_utf8_get_char()</code></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>c</code></em> :</span></td><td> a Unicode character</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <code class="literal">TRUE</code> if <em class="parameter"><code>c</code></em> is printable</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2971946"></a><h3><a name="g-unichar-ispunct"></a>g_unichar_ispunct ()</h3><a class="indexterm" name="id2971957"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a> g_unichar_ispunct (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);</pre><p>Determines whether a character is punctuation or a symbol.Given some UTF-8 text, obtain a character value with<a href="glib-Unicode-Manipulation.html#g-utf8-get-char"><code class="function">g_utf8_get_char()</code></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>c</code></em> :</span></td><td> a Unicode character</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <code class="literal">TRUE</code> if <em class="parameter"><code>c</code></em> is a punctuation or symbol character</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2972041"></a><h3><a name="g-unichar-isspace"></a>g_unichar_isspace ()</h3><a class="indexterm" name="id2972052"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a> g_unichar_isspace (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);</pre><p>Determines whether a character is a space, tab, or line separator(newline, carriage return, etc.). Given some UTF-8 text, obtain acharacter value with <a href="glib-Unicode-Manipulation.html#g-utf8-get-char"><code class="function">g_utf8_get_char()</code></a>.</p><p>(Note: don't use this to do word breaking; you have to usePango or equivalent to get word breaking right, the algorithmis fairly complex.)</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>c</code></em> :</span></td><td> a Unicode character</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <code class="literal">TRUE</code> if <em class="parameter"><code>c</code></em> is a punctuation character</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2972142"></a><h3><a name="g-unichar-isupper"></a>g_unichar_isupper ()</h3><a class="indexterm" name="id2972152"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a> g_unichar_isupper (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);</pre><p>Determines if a character is uppercase.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>c</code></em> :</span></td><td> a Unicode character</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <code class="literal">TRUE</code> if <em class="parameter"><code>c</code></em> is an uppercase character</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2972224"></a><h3><a name="g-unichar-isxdigit"></a>g_unichar_isxdigit ()</h3><a class="indexterm" name="id2972236"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a> g_unichar_isxdigit (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);</pre><p>Determines if a character is a hexidecimal digit.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>c</code></em> :</span></td><td> a Unicode character.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <code class="literal">TRUE</code> if the character is a hexadecimal digit</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2972302"></a><h3><a name="g-unichar-istitle"></a>g_unichar_istitle ()</h3><a class="indexterm" name="id2972313"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gboolean">gboolean</a> g_unichar_istitle (<a href="glib-Unicode-Manipulation.html#gunichar">gunichar</a> c);</pre><p>Determines if a character is titlecase. Some characters inUnicode which are composites, such as the DZ digraphhave three case variants instead of just two. The titlecaseform is used at the beginning of a word where only thefirst letter is capitalized. The titlecase form of the DZdigraph is U+01F2 LATIN CAPITAL LETTTER D WITH SMALL LETTER Z.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -