About string variable capacity


#1

Hi, I would like to know one thing.
How many characters can be stored in String variable on UiPath?

Could you please tell me the maximum size of String variable?

Thanks,
dekochan


#2

Hi @dekochan85,

The theoretical limit may be 2,147,483,647 chars but the practical limit is nowhere near that. Since no single object in a .Net program may be over 2GB and the string type uses unicode (2 bytes for each character), the best you could do is 1,073,741,823 , but you’re not likely to ever be able to allocate that on a 32-bit machine.


#3

Hi akila93,

Thank you very much!
I could understand the limit of it.

Thanks,
dekochan


#4

Hi @dekochan85,

You can get more details here

https://msdn.microsoft.com/en-us/library/sx08afx2.aspx

Regards
Balamurugan


#5

Hi balupad14,

Thank you for your information!

But… umm… I’m just confusing now…

The page in your mentioned URL doesn’t say String variable can store 2GB strings.
I’m developing the robot which read text from file into string variable with read text file activity, so I’m worrying if the text file contains near 1,073,741,823 characters, then the variable may be overflowed…

Is my above concern is correct? or just unnesessary concern?

Could you please answer to me?

Thanks,
dekochan


#6

Hi @dekochan85,

May I know after read the text file into a variable . what is process that you are going to do with it.

Regards
Balamurugan.S


#7

Hi balupad14,

The processes are below.

  1. Read text file content into string variable(like “str”).
  2. Replace specified characters to null(""), means delete specified characters.
  3. Write str into text file.

Thanks,
dekochan