Qt 获取 字符串最后一个字符
1. Qt Helper
const QChar QString::at(int position) const
Returns the character at the given index position in the string.
The position must be a valid index position in the string (i.e., 0 <= position < size()).
2. 示例
最后一个字符的位置就是 : 字符串的长度 减去 1
QString str = "hello world";
qDebug() << "string at end: " << str.at(str.size() - 1);
3. 提醒
别的地方用过: at(-1)来表示最后一个字符,Qt这里好像不行