c# - String manipulation by reference

  • Thread starter Thread starter zxenh
  • Start date Start date
Z

zxenh

I am writing a class that has to take string (by reference) from the
user and maintain it real-time. So, I used a ref parameter in
the constructor. However, i cannot find a way to make the string
reference global in the class. Please help me with this.

Thanks

-zxenh
 
zxenh said:
I am writing a class that has to take string (by reference) from the
user and maintain it real-time. So, I used a ref parameter in
the constructor. However, i cannot find a way to make the string
reference global in the class. Please help me with this.

You can't. What you *could* do is either use a StringBuilder instead,
or write your own class that keeps a string reference inside it, so
that you could change which string reference it had appropriately.
 
Back
Top