Display last 10 characters only

爷,独闯天下 提交于 2019-12-13 05:16:48

问题


I am using an EL to display a String in my GSP.

${grails.util.Holders.config.dataSource.url}

I would like to only display the last ten characters. Any ideas on how I do this?

Thanks


回答1:


${grails.util.Holders.config.dataSource.url[-10..-1]}

See docs: http://groovy.codehaus.org/JN1525-Strings



来源:https://stackoverflow.com/questions/19134649/display-last-10-characters-only

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!