diff --git a/spider-flow-core/src/main/java/org/spiderflow/core/executor/function/extension/StringFunctionExtension.java b/spider-flow-core/src/main/java/org/spiderflow/core/executor/function/extension/StringFunctionExtension.java index 3870bca..5ea7672 100644 --- a/spider-flow-core/src/main/java/org/spiderflow/core/executor/function/extension/StringFunctionExtension.java +++ b/spider-flow-core/src/main/java/org/spiderflow/core/executor/function/extension/StringFunctionExtension.java @@ -2,6 +2,7 @@ package org.spiderflow.core.executor.function.extension; import com.alibaba.fastjson.JSON; import org.apache.commons.lang3.math.NumberUtils; +import org.apache.commons.text.StringEscapeUtils; import org.jsoup.nodes.Element; import org.jsoup.parser.Parser; import org.jsoup.select.Elements; @@ -133,4 +134,10 @@ public class StringFunctionExtension implements FunctionExtension{ public static Date toDate(String source,String pattern) throws ParseException{ return DateFunctionExecutor.parse(source, pattern); } + + @Comment("反转义字符串") + @Example("${strVar.unescape()}") + public static String unescape(String source){ + return StringEscapeUtils.unescapeJava(source); + } }