Generate A-Z in uipath

I need to generate A-Z in uipath with code is that possible

2 Likes

Yes that was doable you can set an array of character and loop on it! @soumi_soumiya

cheers :smiley:

Happy learning :smiley:

1 Like

Hi
We can use this expression inside the while loop
In while loop use condition like this
Counter < 26
Where counter is a variable of type int32 with default value as 0 defined in the variable panel
—now inside the loop use a write line activity like this
Convert.ToChar(65+Counter).ToString

And next to this Writeline activity use a assign activity like this
Counter = Counter + 1

Cheers @soumi_soumiya

2 Likes

@soumi_soumiya,

Try with the following code,

 Enumerable.Range("A"c, 26).[Select](Function(x) CChar(x)).ToArray()
1 Like

Thanks for your reply…
I had also got the other solution related to what you said it work good but I have a doubt that
Convert.ToChar(Convert.ToUInt16(input) +counter) can you explain this why UInt16

2 Likes

@soumi_soumiya, try this-

Enumerable

            .Range(0, 26)

            .ToList()

            .ForEach(i => Console.WriteLine(Convert.ToChar(i + 65 + 0)));
2 Likes

Hi @soumi_soumiya

Try this

Enumerable.Range(0,26).Select(Function(x) Convert.ToChar(Convert.ToUInt16("A"C)+x)).toarray

Regards

2 Likes

Sure
It’s ToInt16 which will convert the input variable to integer
And adds that with counter variable which will give us 65
So converting this 65 to it’s equivalent ASCII code with ToChar will give us A as output
This is how it works

Cheers @soumi_soumiya

3 Likes

Were we able to get them
Kindly let know for any queries or clarification
Cheers @soumi_soumiya

2 Likes