How can I substring a string like /com/app1/main to get the value of main in a HELM template ?
You can use the regexFind function in helm
regexFind "[^/]+$" "/com/app1/main"
Will get the text following the last /
The sprig library that Helm uses provides a substr
function to return a sub-string.
Some other useful functions are trunc
(truncate), trim
and regexFind
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With