Maximum byte size for a string

I am downloading the response from an api into a string.  The data are likely to be very large (several 10s of Mbytes)

I am having problems and was wondering if there is a limit to the size that strings can take?