About string variable capacity

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

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.

2 Likes

Hi akila93,

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

Thanks,
dekochan

Hi @dekochan85,

You can get more details here

Regards
Balamurugan

1 Like

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

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

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

I am performing same operations. And getting below error for text read activity:

19.4.4+Branch.support/v2019.4.Sha.6d308c7f5a32b559373887ae421ce7eaec8f8d24

Message: Could not retrieve the result of the job execution. This might be because a message was too large to process.

Exception Type: System.Exception

An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.Exception: Could not retrieve the result of the job execution. This might be because a message was too large to process.

@dekochan85 @Sourabh_Thorwat Please share xaml
@balupad14 @akila93 has anybody got the solution for this ?

Any solution on this ?