0

I have a variable with values like

30S, 2H, 5D

where S,H and D stands for Seconds, Hours and Days.

I want to extract "S/H/D" from the variable and convert into the time period - string "Seconds/Hours/Days".

Is there any builtin methods that I can use to resolve above issue.

Rakesh.N
  • 151
  • 7
  • 12
  • Look at the answer of Brian on this topic : https://stackoverflow.com/questions/16773599/java-equivalent-to-explode-and-implodephp – devseo Feb 03 '20 at 08:16

1 Answers1

0

In freemarker you can use the built-in replace method.

It is used to replace all occurrences of a string in the original string with another string.

For example,

${"this is a car acarus"?replace("car", "bulldozer")}

will print:

this is a bulldozer abulldozerus

Check more here: Built-in for strings

Fotiou D.
  • 431
  • 6
  • 11