Strings manipulation performance

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi there

This is the situation .

there is a huge string that pass as a parameter in a method

The method just look for a value in the string, and return it

The methos is invoked by another method in the same proces

What is the best way to do this? (C#

- a) string ExtractValue (string HugeString
- b) string ExtractValue (ref string HugeString
 
You do not neet to pass the string by reference explicitly, it is a
reference type so all that will be passed in (1) is a pointer to the string
data. If you pass by ref you are passing a pointer to a pointer to the
string data, which you do not want to do in this case.

Greg

This posting is provided "AS IS"with no warranties, and confers no rights.
 
Back
Top