Using system;
namespace Pattern {///
Public class repa: Strategy {public REPA () {} public override void replace () {this.m_newstr = this.m_oldstr "aaaa";
}
Public class repb: strategy {public repb () {} public override void replace () {this.m_newstr = this.m_oldstr "bbbb";
}} // strategy mode // strategy r1 = new repa (); // r1.setoldstring ("good"); // r1.Replace (); // console.writeLine (r1.getnewstring ()); ///// // REPB R2 = New REPB (); // r2.SETOLDSTRING ("Good"); // r2.Replace (); // console.writeLine (R2.GetNewstring ());