import java.util.Scanner; /** * [程序38] * * 题目:写一个函数,求一个字符串的长度,在main函数中输入字符串,并输出其长度. * * @author James * */ public class 第三十八题统计字符串的长度 { public static void main(String[] args) { System.out.println("请输入一个字符串"); Scanner in = new Scanner(System.in);
把QString写到文件中可以用toutf8()函数 QByteArray QString::toUtf8() const Returns a UTF-8 representation of the string as a QByteArray. UTF-8 is a Unicode codec and can represent all characters in a Unicode string like QString.