当前位置:网站首页>qt中qstring合并字符串
qt中qstring合并字符串
2022-07-29 21:05:00 【Loading_create_scc】
合并字符串
第一种
Qstring str1 = "hello ";
str1 = str1 + “world”;
qDebug() << str1;
QString str2 = "I love ";
str2 += “you!”;
cout << str1.toStdString() << endl << str2.toStdString() << endl;
第二种
QString str3 = "Welcome ";
QString str4 = "to ";
str3.append(str4);
第三种
QString str5;
str5 = QString(“I bought %1 pounds %2 apples”).arg(10).arg(“red”);
第四种
QString str6;
sr6 = str6.asprintf(“%s”, “welcome”);
QByteArray ba = str6.toLocal8Bit();
const char * c_str = ba.data();
str6 = QString::asprintf(“%s %s %s”, c_str, “to”, “the future!”);
边栏推荐
- 容器网络硬核技术内幕 (26) 知微知彰,知柔知刚 (下)
- The demand for VR live broadcast marketing is increasing, and the data module is paving the way for us
- 容器网络硬核技术内幕 (25) 知微知彰,知柔知刚 (中)
- 笔记:fgets函数详解
- WeChat Mini Program 31 Subcontracting Mechanism
- PyQt5学习一(环境搭建)
- Minimal jvm source code analysis
- 从实例学Kettle(一):获取股票行情数据
- 容器网络硬核技术内幕 (24) 知微知彰,知柔知刚 (上)
- 错误解决:Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255]
猜你喜欢

Fully automated machine learning modeling!The effect hangs the primary alchemist!

In 2022, you still can't "low code"?Data science can also play with Low-Code!

C# WPF给综合实战项目加个帮助文档

微信小程序 30 自定义模板和获取用户登录凭证

LeetCode 0144. 二叉树的前序遍历:二叉树必会题

程序员自由工作的三大痛点?一文教你统统解决

336. 回文对

全系都更换带T四缸,安全、舒适一个不落

OneNote 教程,如何在 OneNote 中做笔记?

Second Best PyTorch Beginner Course; Thesis Writing Guide; Using µGo to Develop a Mini Compiler; Super Efficient Use of Transformer's Extension Library; Frontier Papers | ShowMeAI News Daily
随机推荐
7 行代码搞崩溃 B 站,原因令人唏嘘!
关于 golang 错误处理的一些优化想法
Come in now!!!Take you to know the basic data types of C language
mdnice-test
378. 有序矩阵中第 K 小的元素
数组和List互转
解决报错 WARNING: IPv4 forwarding is disabled. Networking will not work.
全自动化机器学习建模!效果吊打初级炼丹师!
回归——分层回归
防火墙——SNAT和DNAT策略的原理及应用、防火墙规则的备份和还原
The sword refers to Offer II 097. Number of subsequences
Chrome浏览器打印flash log
Qualcomm WLAN framework learning (31) -- Power save
解释器模式
一 JS中Promise用法、二闭包的概念与用法、三对象创建的四种方式与区区别、四 如何声明一个类
A dish hold up valuations billions of mt. Pickled fish, can move beyond the edge food safety?
容器网络硬核技术内幕 (25) 知微知彰,知柔知刚 (中)
相亲信息
一线技术人应该关注的四种思维能力
模型推理模板