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.
我有一个字符串test="this is a string string"。现在我使用以下方法替换字符串的两种外观:
test="this is a string string"
new_test="${test//string/}"
相反,我只想替换字符串的第一次出现。
我怎样才能做到这一点?
你有没有尝试过:
new_test="${test/string/}"