{ "conversationId": "cid17PxV+L9tQGSnS3pMQNRMw==", "atUsers": [ { "dingtalkId": "$:LWCP_v1:$J8oaMSWAlr76svNir8LD6YwqM/Aa+6eo" } ], "chatbotUserId": "$:LWCP_v1:$J8oaMSWAlr76svNir8LD6YwqM/Aa+6eo", "msgId": "msgCQfjQC2acf/VNBZoK0mqQg==", "senderNick": "凯宾斯基", "isAdmin": false, "sessionWebhookExpiredTime": 1650059346028, "createAt": 1650053945855, "conversationType": "2", "senderId": "$:LWCP_v1:$UENgJ9RNsle+pcvbHr6cCA==", "conversationTitle": "群消息应答-TEST", "isInAtList": true, "sessionWebhook": "https://xxxxx.com/sendBySessionXXXX", "text": { "content": " 你号啊" }, "robotCode": "normal", "msgtype": "text" }
获取上面json里面text 里 content 的值
replaceAll是替换API
如果获取的键里面的值还是json 那么要用getJSONOBJect
String content = json.getJSONObject("text").get("content").toString().replaceAll(" ", "");