gpt4 book ai didi

android - 使用android在字符串中添加双引号

转载 作者:太空狗 更新时间:2023-10-29 15:31:13 25 4
gpt4 key购买 nike

我在 forloop 中有一个字符串,我想把它添加到另一个字符串中,就像给定的格式一样

for (int i = 0; i < profiles.length(); i++) {
JSONObject c = profiles.getJSONObject(i);
String admnno = c.getString(TAG_ADMNNO);
}

结果应该是这样的

"Rajesh", "Mahesh", "Vijayakumar"
or
final CharSequence[] items = {"Rajesh", "Mahesh", "Vijayakumar"};

adminno 应该用双引号和逗号括起来。它在 android doin Background()

最佳答案

为此使用\"

例如 String str="\"Rajesh\""

关于android - 使用android在字符串中添加双引号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28361995/

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