This tutorial we learn about how we can do velocity split string.
Velocity has a minimal number of its own objects and methods. Instead, it empowers you to interact with authentic Java objects and invoke genuine Java methods on those objects. The Velocity documentation specifies that the delimiter is a string.Furthermore, due to Velocity being Java-based, a string serves as a data type capable of storing diverse information types like phone numbers, names, identifiers, and regular expressions. In Java, numerous methods that handle regular expressions accept these expressions as String objects.
Below is the example to split a string in velocity split method
$profile.productId.split("[|]")
With a Loop method
#foreach( $profile in $browseSiteProfile )
alert("$profile.productId");
#foreach( $stringList in $profile.productId.split("|") )
alert("inner loop");
#end
#end