vrushali katkade

vrushali katkade

  • NA
  • 128
  • 46.2k

Replace string with another string

Sep 30 2011 1:06 AM
in my string variable this code is stored & I want to replace this string

this.Watermark.Text =" VALUE"

to

this.Watermark.Text = "Trial version";

string variable data

string Reportsetting=this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] {
this.Detail,
this.TopMargin,
this.BottomMargin});
this.Margins = new System.Drawing.Printing.Margins(0, 100, 100, 42);
this.Name = "rptTableReport1";
this.PageHeight = 1100;
this.PageWidth = 850;
this.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopJustify;
this.Version = "11.1";
this.Watermark.Text="ABC"
this.Watermark.Font = new System.Drawing.Font("Verdana", 40F);
this.Watermark.ForeColor = System.Drawing.Color.DodgerBlue;
this.Watermark.ShowBehind = false;
this.Watermark.TextTransparency = 170;
((System.ComponentModel.ISupportInitialize)(this)).EndInit();

i have used the following coding


string oldSTR = @"this.Watermark.Text ="" ABC""; ";
string newSTR = @"this.Watermark.Text = ""TRIAL VERSION"";";
Reportsetting.Replace(oldSTR, newSTR);



in string variable i have already this.Watermark.Text =" VALUE" & i want to replace this value how to replace this value?

thanks in advance..

Answers (1)