mirror of
https://github.com/pppscn/SmsForwarder
synced 2025-08-04 01:47:40 +08:00
优化:支持正则替换===右边
添加\n用于手动换行
This commit is contained in:
parent
bb4e44c419
commit
ad65e094b7
@ -100,7 +100,7 @@ data class MsgInfo(
|
|||||||
val lineSplit = line.split("===".toRegex()).toTypedArray()
|
val lineSplit = line.split("===".toRegex()).toTypedArray()
|
||||||
if (lineSplit.isNotEmpty()) {
|
if (lineSplit.isNotEmpty()) {
|
||||||
val regex = lineSplit[0]
|
val regex = lineSplit[0]
|
||||||
val replacement = if (lineSplit.size >= 2) lineSplit[1] else ""
|
val replacement = if (lineSplit.size >= 2) lineSplit[1].replace("\\\\n".toRegex(), "\n") else ""
|
||||||
newContent = newContent.replace(regex.toRegex(), replacement)
|
newContent = newContent.replace(regex.toRegex(), replacement)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user