Kytyzow
February 22, 2022, 12:16pm
1
I have a queue which is filled with QueueItems. After filling, each field is either written with alphanumeric, it is null or Empty.
Currently I detect the number of full fields with the lambda
TransactionItem.SpecificContent.Where(Function (x) Not IsNothing(x.Value)).Count
However, this also counts the Empty fields. What is the way to read only the number of full fields in the TransactionItem?
Lak_Ui
(Lakshmi)
February 22, 2022, 1:09pm
2
can you Trim x.Value and check if it works?
Ramya_K
(Ramya K)
February 22, 2022, 7:09pm
3
@Kytyzow ,
Try checking for empty strings also.
TransactionItem.SpecificContent.Where(Function (x) (Not IsNothing(x.Value) and Not String.IsNullOrEmpty(x.Value) )).Count
Unfortunately, this did not work. In itself, the field content is trimmed, but since the field is already empty, this does not fix the problem.
Unfortunately, that was not the solution either.
My goal was to recognize before the loop how often it may run. Now I used a head based loop and check (with SpecificContent) right at the beginning if the content is Empty or Null. The loop now runs as long as the fields are not empty.
Thanks for your suggestions!
system
(system)
Closed
March 4, 2022, 10:40am
6
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.