Trim String in Power Automate Flow

In this video we will take a string of 12345678910111213141516 and trim it to output 12345.

Code used:
if(greater(length(variables(‘Large Var’)),5),
take(variables(‘Large Var’),5),
variables(‘Large Var’)
)

You can watch the full video here:
https://youtu.be/Zykkx_EcOeo