Extend Method is a new attribute for C Sharp.
I like it for it just like loading some package with my arms as using extended method.
During my coding, i need to combine 2 string into a new one frequently.
And, Our "String" class does not offord one method like this append one string to another sting.
Everything i want this, i have to create a StringBuilder and make some combinings .......
A little and more garbage will reproduce....
Then, i get a new idea to extend string method:
public static string AppendRight(this String theOrginal, params String[] theattends)
{
StringBuilder stringbuild = new StringBuild(theOrginal);
foreach( String myString in theattends )
{
stringbuild.Append(myString);
}
return stringbuild.tostring();
}
Then, i can use it like this:
string one = "it is one".
one.AppendRight("yes","it is");
What i got is "it is oneyesit is".
COOL.
I like it.