Converting C++ code to C#

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

Guest

I am converting C++ code to C#, I came across a few C++ functions that I need
to match up to a C# function.
My question is What C# methods are used to replace the following C++ methods?
_ecvt - (converts a double to string)
_gcvt - (Converts a floating-point value to a string, which it stores in a
buffer).
string.append
strlen
string.find
string.resize

Thanks
 
rgarf said:
_ecvt - (converts a double to string)
_gcvt - (Converts a floating-point value to a string, which
it stores in a buffer).

double d = 10.5;
string s = d.ToString(); // "10.5"
string.append

s += "some more text";

int i = s.Length;
string.find

int i = s.IndexOf("text to find");
string.resize

You don't need it. C# strings are dynamically allocated.

P.
 
Back
Top