Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have the two paragraphs below in a multiline textbox and I want to:

Replace the numbers 1 and 2 with Q1 and Q2, and
Remove all the quotes.
According to Forbes & Hawranik (found in Kulig & Williams, 2012), which of the following is a unique characteristic of rural residents with dementia?

A. They are less likely to have an adult child to assist them with care. B. They experience a delay in dementia diagnosis. C. There is a greater reluctance in accepting specialized care. D. They tend to have a later onset of dementia than their urban counterparts.
A nurse speaks at a staff development in-service. Which statement by a nurse participant shows the need for education?
A. “I know that the consequences of discrimination are still present and they're linked to health disparities.” B. “I'm sure the percentage of client-care hours that we spend working with minority clients is bound to increase.” C. “Some may erroneously assume that there are few health disparities because Canada has a universal health care system.” D. “It's inaccurate to link the prevalence of particular diseases with particular minority groups.”

What I have tried:

I have tried this code but to no avail

For i = 0 To Val(textcon.Lines.Count) - 1

If textcon.Lines(i).Contains(Chr(34)) Then
MyStringBuilder.Replace(Chr(34), "#")
End If
next

Help please
Posted
Updated 8-Jun-17 20:01pm

Note that those quotes aren't '"', they are text processor "special quotes": '“' at the beginning, and '”' at the end.
Try this:
VB
Dim s As String = myTextBox.Text
s = s.Replace("1", "Q1")
s = s.Replace("2", "Q2")
s = s.Replace("""", "")
s = s.Replace(""", "")
s = s.Replace(""", "")
myTextBox.Text = s
 
Share this answer
 
Yes you are right the quotations are different that is why I cant get to work

MyStringBuilder.Replace(ans, "}::Q" & y & "::").Replace(Chr(147), "").Replace(Chr(148), "")


i have used this and it is working thanks to Jay Patel--for looking in the chr codes

and thank you too.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900