In a variable i have 12 names, now i want to extract only first 11 values from that variable. How can i do that, can anyone help me please.
hi @sandhyarani , is this a String Array that you need to print? In that case you can loop and print till your desired index value.
Hi @sandhyarani ,
Welcome to the community.
You can use string manipulation
How to manipulate a part of string: Split, Trim, Substring, Replace, Remove, Left, Right - News / Tutorials - UiPath Community Forum
Hope this will help you.
Please dont forget to mark this thread as solution, if this helps you.
Regards
Hi @sandhyarani ,
Can you specify what is the type of variable?, and if the variable is a string, then how are each of the values separated?
Regards,
array of strings only. separated by ,
Hi @sandhyarani ,
Maybe an extension on @vishal.kp Post :
ArrayOfStringVariable.Take(11).ToArray
Also, If Required in String Format :
String.Join(",",ArrayOfStringVariable.Take(11).ToArray)
Number,Correlation display,Short description,Caller,Affected user,State,Assigned to,Updated,Updated by,Assignment group,Created,Resolved,
this is the string i have. I want only till Created one
If it is a String variable, then maybe a Split first and then perform the Take Operation :
Split(YourStringVar,",").Take(11).ToArray
Also, let us know if we need to go by the Condition based on value or by the number of values.
i am just getting like this Sytem.String
Number of values only.
Maybe you require it in the String format, do check the post before and use String.Join(",")
for the conversion and check.
We would need to know what is the format you want the output to be stored or Represented.
I should get the output, same like input format only.
Array1 = {“1”, “2”, “3”…}
Now declare another or the same Array variable
Now write as Array1 = Array1.Take(11).ToArray()
Hope this will help you
Thanks,
Srini
Here, i am getting an error like Array is a type cannot be used as an expression.
i am getting an error like cannot assign from system char to system string