Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
"}"找到特定字符串后,我需要找到第一个右括号。字符串如下:
"}"
......“消息”:“RM06050”}]
我需要先找到 " RM06050 " ,然后找到第一个右大括号并在那里添加一个字符串,例如在上面的字符串中,我想在 "}" 之后但 "]" 之前添加 "This is added string"。字符串和大括号之间的空白字符可能会有所不同...
尝试这个
int i = s.indexOf('}', s.indexOf("\"RM06050\""));