Hi all, Good afternoon.
I am using invoke code activity in UiPath. How to get the array length in vb. Net code.
I have used array name. Length but it won’t worked.
Hi all, Good afternoon.
I am using invoke code activity in UiPath. How to get the array length in vb. Net code.
I have used array name. Length but it won’t worked.
@BHUVAN
try with UBound(array)

Length is correct. What is the error you are getting?
Dim numbers() As Integer = {1, 2, 3, 4, 5}
Console.WriteLine("The length of the array is: " & numbers.Length)

Hi @BHUVAN
Try this:
Dim myArray As Integer() = {1, 2, 3, 4, 5} ' Example array, replace it with your array
Dim arrayLength As Integer = myArray.Length
Console.WriteLine("Length of the array is: " & arrayLength.ToString())
Check the below image and Output for better understanding:
Hope it helps!!
@BHUVAN
Instead of UBound(array1) give array1.Length
@mkankatala thanks for helping me. ![]()
It’s my pleasure @BHUVAN
Happy Automation!!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.