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.
replaceAll()交换相邻字符的正则表达式是什么?
replaceAll()
例如,要转这个:
abcdefg
进入这个:
badcfeg
"abcdefg".replaceAll("(.)(.)", "$2$1")
这将返回badcfeg。