Every of this method returns new string, so basicaly this are methods called on string returning string. You can create your own class, create methods and run it like this.
Very important is to notice that string is immutable, so calling for e.g. Trim
on string won't change it.
public string Trim()
{
return this.TrimHelper(2);
}
this is how Trim
looks like, no magic just simple method.
If your class won't be immutable best way is to create extension methods for your class. You can read more about extension methods here.
Example with normal methods
public class Test
{
public int Prop {get;set;}
public Test DoStuf()
{
Prop=1;
return this;
}
public Test DoOtherStuff()
{
return new Test();
}
}
and use it:
var test = new Test();
test.DoStuff().DoOtherStuff();