我正在尝试使用VTL中的substring方法,如下所述
#set ($Score = $row.getValue("Score").substring(0,$row.getValue("Score").length()-1))但上面写着
Encountered "-1" at
Was expecting one of:
"," ...
")" ...
<WHITESPACE> ...
<DOT> ...请帮我解决这个问题。
谢谢Kishore
发布于 2011-03-08 00:01:27
#set( $value = $row.getValue("Score") )
#set( $len = $value.length() - 1 )
#set( $Score = $value.substring(0, $len))或者,如果你使用的是VelocityTools,你可以做这个丑陋的事情:
#set( $Score = $row.getValue("Score").substring(0, $math.sub($row.getValue("Score").length(), 1) )https://stackoverflow.com/questions/5220448
复制相似问题