gpt4 book ai didi

java - 连接字符串和空字符

转载 作者:行者123 更新时间:2023-12-01 17:21:55 25 4
gpt4 key购买 nike

我对java完全陌生,我正在尝试将字符串连接在一起,并在它们之间使用空字符。

String header = "text 19"
String content = "this is the content"
String wholething = // this is supposed to be "text 19\0this is the content"

这里的最终目标是获取全部内容的 sha-1 总和并将全部内容写入文件。我尝试过一些谷歌搜索,但不知道该怎么做。

最佳答案

String wholething = header + '\0' + content;

连接字符串的其他方法(无特定顺序),每种方法都有自己的特定用途:

关于java - 连接字符串和空字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18093259/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com