扫描QR码时,我想将数据打印为列表

发布于 2025-02-12 20:35:51 字数 542 浏览 3 评论 0原文

将有一个特殊的QR码,此QR代码中将有顺序信息。当看到一个空间或符号(@)时,我可以在底线的传入QR码中打印信息吗?

https://www.hizliresim.com/qcc4feyi

------------- href =“ https://www.hizliresim.com/rkajsoy” rel =“ nofollow noreferrer”> https://www.hizliresim.com/rkajsoy ---------------------------------------------------------------》

https://www.hizliresim.com/lnd387j - 扫描时------流程和权限

There will be a special qr code and there will be sequential information in this qr code.Can I print the information in the incoming qr code on the bottom line when it sees a space or a symbol(@)?

https://www.hizliresim.com/qc4feyi ----- Screen output is undesirable

https://www.hizliresim.com/rkajsoy ----- Desired

https://www.hizliresim.com/lnd387j ----- Processes and permissions when scanned

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

弥繁 2025-02-19 20:35:51

使用\ n新行

alert("Color@100@42@1$".replace(/@/g, "@\n"))

编辑后

const text = "Color@100@42@1$".replace(/@/g, "@<br />");

document.getElementById('text').innerHTML = text;
<div id="text" />

编辑后:添加了标签

const data = '@Red@Pros@42@1
<div id="text" />

.split('@'); const labels = ['Color', 'Shape', 'Weight', 'Price']; let text = data.map((item, i) => (item ? `${labels[i]}:${item}` : item)); text = text.join('<br />'); document.getElementById('text').innerHTML = text;

Use \n for new line

alert("Color@100@42@1$".replace(/@/g, "@\n"))

After edit

const text = "Color@100@42@1$".replace(/@/g, "@<br />");

document.getElementById('text').innerHTML = text;
<div id="text" />

After edit : added labels

const data = '@Red@Pros@42@1
<div id="text" />

.split('@'); const labels = ['Color', 'Shape', 'Weight', 'Price']; let text = data.map((item, i) => (item ? `${labels[i]}:${item}` : item)); text = text.join('<br />'); document.getElementById('text').innerHTML = text;

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文