Aki1111
(Akira)
March 3, 2025, 11:36am
1
Hi I Currently have a classification result which displays nothing for index 0.
ClassificationResult[0] { }
I need to do a check for that index to check if its null or empty.
I have tried this:
If ClassificationResult(0) Is Nothing OrElse String.IsNullOrEmpty(ClassificationResult(0).ToString)
But this syntax does not seem to work.
any idea of how can do this?
@Aki1111 ,
Try this.
ClassificationResult IsNot Nothing And ClassificationResult.Any AndAlso (ClassificationResult(0) IsNot Nothing AndAlso Not String.IsNullOrEmpty(ClassificationResult(0).ToString))
1 Like
adi.mehare
(Aditya Mehare)
March 3, 2025, 11:39am
3
you can check like ClassificationResult Is Nothing AndAlso ClassificationResult.Count() > 0
1 Like
Somanath1
(Somanath Aland)
March 3, 2025, 11:40am
4
@Aki1111
try this
If ClassificationResult.Count = 0 OrElse ClassificationResult(0) Is Nothing OrElse Not ClassificationResult(0).Any Then
Log Message: “Classification result is empty.”
Else
Process ClassificationResult(0)
End If
1 Like
Aki1111
(Akira)
March 3, 2025, 2:18pm
5
Thank you this seemed to work.
1 Like
system
(system)
Closed
March 6, 2025, 2:18pm
6
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.