Hi all,
I'm trying to get a boolean output from a string expression. Simply, if there is no text (null) give me 1, if there is some text give me 0. I'm using the following but to no avail.
A == "" ? 1 : 0
How do I express a null value in a String Expression?
I'm getting 'cannot convert int to string'.
Thanks,
Chris
Hello Ventuzians!
THE FORUMS ARE CLOSED!
Please join our discord server HERE!! << click me
We are shutting our Ventuz Forum, but don't worry, it will all be archived for you to search in if you have a query. From now on, please add all your comments, questions or observations into our Discord Server
Thanks for the great time - see you on discord!!
Dee, Karol, Daniel and the whoooole Product and Support team!
THE FORUMS ARE CLOSED!
Please join our discord server HERE!! << click me
We are shutting our Ventuz Forum, but don't worry, it will all be archived for you to search in if you have a query. From now on, please add all your comments, questions or observations into our Discord Server
Thanks for the great time - see you on discord!!
Dee, Karol, Daniel and the whoooole Product and Support team!
Expression Help
Moderator: Support
Re: Expression Help
Does it have to be an expression? I'd just use the "String Length" node, you feed the string into it and it gives you a number of informative outputs, among them a boolean as to whether the string is empty.
http://www.ventuz.com/support/help/late ... tions.html
http://www.ventuz.com/support/help/late ... tions.html
- Daniel Willer
- Posts: 309
- Joined: 06 Jan 2012, 18:12
Re: Expression Help
You can use the IsNullOrEmpty() method.
Your Int expression should look like that: String.IsNullOrEmpty(A) ? 1:0
Check MSDN for further information.
By the way you cannot output a 0 or 1 in a string expression because the result has to be a string. But you can add a string arguement via the CustomModel to an Integer Expression.
Cheers!
Your Int expression should look like that: String.IsNullOrEmpty(A) ? 1:0
Check MSDN for further information.
By the way you cannot output a 0 or 1 in a string expression because the result has to be a string. But you can add a string arguement via the CustomModel to an Integer Expression.
Cheers!