return '0' <= c && c <= '9';
}
+bool isNumberChar(char_type c)
+{
+ if (c > ucs4_max)
+ // outside the UCS4 range
+ return false;
+ return ucs4_to_qchar(c).isNumber();
+}
bool isAlnumASCII(char_type c)
{
}
+int wordCount(docstring const & d)
+{
+ docstring dt = trim(d);
+ if (dt.empty())
+ return 0;
+ int words = 1;
+ for (auto const & c : dt) {
+ if (isSpace(c))
+ words++;
+ }
+ return words;
+}
+
+
+
int count_bin_chars(string const & str)
{
QString const qstr = toqstr(str).simplified();
}
+int countExpanders(docstring const & str)
+{
+ // Numbers of characters that are expanded by inter-word spacing. These
+ // characters are spaces, except for characters 09-0D which are treated
+ // specially. (From a combination of testing with the notepad found in qt's
+ // examples, and reading the source code.)
+ int nexp = 0;
+ for (char_type c : str)
+ if (c > 0x0d && isSpace(c))
+ ++nexp;
+ return nexp;
+}
+
+
docstring bformat(docstring const & fmt, int arg1)
{
LATTEST(contains(fmt, from_ascii("%1$d")));