How to correctly split strings in JSTL?

后端 未结 3 797
萌比男神i
萌比男神i 2020-12-09 17:14

How can I split strings separated by \"/\" inside a jsp page using JSTL?

I have a string in this format: **

\"23/11/2010\"

3条回答
  •  一向
    一向 (楼主)
    2020-12-09 17:30

    It's worth noting for anyone else who finds this question in their searching (as I did) that JSTL has the useful tag . This will split the input string by a supplied delimiter and then iterate over the resultant collection of tokens.

    As demonstrated here, the following code:

    
       

    Would result in:

    A
    B
    C
    D
    

    Documentation: JSTL core Tag forTokens

提交回复
热议问题