0

I have a string in textbox like this

 xxxxxxxxxxx    310041              xxxxx   xxxxxx    xxxx xxxx
  RTE STAT: 00 AUTH ID RESP:         ERR FLAG: 0   PEM: M (02)   ATC: 000000
    RVSL REASON: 00       TELLER/SERIAL:          /         TERM CAP: 5 (EMV)

i need to remove this RTE STAT: 00 AUTH ID RESP: ERR FLAG: 0 to

txtRemark.Text.Replace("  RTE STAT: 00 AUTH ID RESP:         ERR FLAG: 0   ", "")

but nothing happened i try with regex but it's not happened too

result must be like this

 xxxxxxxxxxx    310041              xxxxx   xxxxxx    xxxx xxxx
 PEM: M (02)   ATC: 000000
 TERM CAP: 5 (EMV)
2
  • Did you assign the value to the txtRemark.Text? txtRemark.Text = txtRemark.Text.Replace(" RTE STAT: 00 AUTH ID RESP: ERR FLAG: 0 ", "") Commented Jan 25, 2016 at 9:15
  • my example is the txtRemark.Text value Commented Jan 25, 2016 at 9:15

1 Answer 1

2

As per the documentation, the .Replace method yields back the replace string. You will need to change your code from txtRemark.Text.Replace(" RTE STAT: 00 AUTH ID RESP: ERR FLAG: 0 ", "") to txtRemark.Text = txtRemark.Text.Replace(" RTE STAT: 00 AUTH ID RESP: ERR FLAG: 0 ", "").

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.