Retro said:
Hello
Say i have two varibles one name var1 and the other var2,
var1 holds the string "C:\" and var2 holds "games" is there a command
to combian the two?
When i use C++ i could use the command strcat(var1, var2);
Well, of course, in C++ you could also use the string class in the
standard library:
std::string var1 = "C:\\";
std::string var2 = "games";
std::string var3 = var1+var2;
In C# the System.String class behaves the exact same way:
System.String var1 = "C:\\";
System.String var2 = "games";
System.String var3 = var1 + var2;
Is there a command like "strcat" in c#?
Now, if you really mean that you want to control it at this low a level,
there is the StringBuilder class as well which will allow you more direct
control of the string buffers.
System.Text.StringBuilder sb1 = new System.Text.StringBuilder("C:\\");
sb1.Append(var2);
This will have an effect which is very close to the way that strcat works.
--
Reginald Blue
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my
telephone."
- Bjarne Stroustrup (originator of C++) [quoted at the 2003
International Conference on Intelligent User Interfaces]