【发布时间】:2016-12-29 09:44:04
【问题描述】:
我正在尝试使用 JSTL 方法拆分字符串,并根据四个引号 '''' 拆分它。详情如下:
example = ''''THE FAMOUS DIAMONDS''''This is second string for the example''''/content/dam/rcq/mp_push_tank_style.jpg''''right''''
${fn:split(example,\"''''\")}
example[0]=THE FAMOUS DIAMONDS
example[1]=This is second string for the example
example[2]=/content/dam/abc/tank.jpg
example[3]=right
对于上面提到的字符串,它工作正常,但问题是每当它们在我的字符串中是 '(single quote) 时,它的功能就会中断。下面是例子
example = ''''THE FAMOUS DIAMONDS''''This is string's contains single quote''''/content/dam/rcq/mp_push_tank_style.jpg''''right''''
${fn:split(example,\"''''\")}
example[0]=THE FAMOUS DIAMONDS
example[1]=This is string
example[2]=s contains single quote
example[3]=/content/dam/abc/tank.jpg
现在,如您所见,示例 [2] 包含文本而不是图像路径。
任何人都可以帮忙,因为我无法更改拆分类型''''。
提前致谢
【问题讨论】:
标签: split jstl jstl-functions