6
替換字符串我有一些像如何在Groovy
C:\dev\deploy_test.log
我想串用的Groovy的手段字符串轉換爲
C:/dev/deploy_test.log
我嘗試用命令來執行它
Change_1 = Log_file_1.replaceAll('\','/');
它不轉換此字符串
替換字符串我有一些像如何在Groovy
C:\dev\deploy_test.log
我想串用的Groovy的手段字符串轉換爲
C:/dev/deploy_test.log
我嘗試用命令來執行它
Change_1 = Log_file_1.replaceAll('\','/');
它不轉換此字符串
您需要跳過反斜槓\
:
println yourString.replace("\\", "/")
。是!它工作正常! –