Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String.length is not working in handlebars template #152

Open
AndreasScharfCPB opened this issue Jun 7, 2023 · 2 comments
Open

String.length is not working in handlebars template #152

AndreasScharfCPB opened this issue Jun 7, 2023 · 2 comments

Comments

@AndreasScharfCPB
Copy link

I am trying to use substring. But I cannot figure out the length of my String.
According to Handlebars a .length should be possible but within the Jenkins pipeline it is not.

Try {{person.lastname.length}} in https://handlebarsjs.com/examples/path-expressions-dot.html

Does not work in Jenkins with {{issue.length}}

@tomasbjerre
Copy link
Owner

This library uses this implementation of Handlebars:
https://github.com/jknack/handlebars.java

I do not see any length helper in those docs.

How do you want to use substring? What is the original value and what do you want it to be after substring?

@AndreasScharfCPB
Copy link
Author

oh okay, that would explain why the function is not there.
I am using substring on String that is not static to cut the end that I dont need because it is wrapped by "[]". But as I do not know the length of the String I am not able to cut the last character from it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants