问题
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