473,324 Members | 2,214 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Replace unwanted characters, ask for help!!!

48
Dear friends,

I want to read a file, for instance, "testing.txt". Then, I need to put it in a text box.

Expand|Select|Wrap|Line Numbers
  1. Dim stExample As String
  2. stExample = there is something on your right side.
I need to scan throught this sentence and replace "right" to "left", then the whole sentence will put into a text box.

Appreciate for any reply. Thank you.

Best Regards.
Mar 11 '07 #1
7 1769
bergy
89
Using your example (but you forgot your quotes!!) it would work like this:

Expand|Select|Wrap|Line Numbers
  1. Dim stExample As String
  2. stExample = "there is something on your right side"
  3. stExample = stExample.Replace("right", "left")
One of the easist ways to learn VB is to use the code editor to guide you. I.E. If you were to type stExample. you'd get a drop down menu (as soon as you typed the period ".") showing you all the operations you can do to the string, and most of the time they're pretty straight forward (replacing text uses the Replace function on the list).

Hope that helps you and good luck learning VB!

Adam

Dear friends,

I want to read a file, for instance, "testing.txt". Then, I need to put it in a text box.

Expand|Select|Wrap|Line Numbers
  1. Dim stExample As String
  2. stExample = there is something on your right side.
I need to scan throught this sentence and replace "right" to "left", then the whole sentence will put into a text box.

Appreciate for any reply. Thank you.

Best Regards.
Mar 11 '07 #2
willakawill
1,646 1GB
Which version of vb are you using?
Mar 11 '07 #3
kuzure
48
Which version of vb are you using?
VB6. By the way, its not working, it showed complie error : method or data member not found.

Do I need to enable any component?

Best Regards.
Mar 11 '07 #4
willakawill
1,646 1GB
VB6. By the way, its not working, it showed complie error : method or data member not found.

Do I need to enable any component?

Best Regards.
No. The advice you were given is for vb.net and will not work for you. That is why I asked you which version you are using.

So are you asking how to open a text file in vb6?
Also are you asking how to find and replace a word in that text file?
Finally are you asking how to put that altered text into a textbox on a form?
Mar 11 '07 #5
kuzure
48
No. The advice you were given is for vb.net and will not work for you. That is why I asked you which version you are using.

So are you asking how to open a text file in vb6?
Also are you asking how to find and replace a word in that text file?
Finally are you asking how to put that altered text into a textbox on a form?

Thanks for the reply. Well, yes, you are right. That's what I really need, especially the part of "replace". I only can use VB6 to do it, and of course, I know nothing about VB.net. haha^^

Best Regards.
Mar 11 '07 #6
willakawill
1,646 1GB
Thanks for the reply. Well, yes, you are right. That's what I really need, especially the part of "replace". I only can use VB6 to do it, and of course, I know nothing about VB.net. haha^^

Best Regards.
In your vb6 help, look up 'Replace function'
Mar 11 '07 #7
kuzure
48
In your vb6 help, look up 'Replace function'

Expand|Select|Wrap|Line Numbers
  1. Dim str1 as String
  2. str1 = Replace(Original, tobeReplaced, Replacement)
Thanks, it works. Thats the answer.

Best Regards.
Mar 20 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

17
by: Pikkel | last post by:
i'm looking for a way to replace special characters with characters without accents, cedilles, etc.
2
by: yearTiger2002 | last post by:
Our company's back end database server does not handle french accentuated characters well. We need to replace those characters with english letters when validating the form inputs. Any suggestions?...
7
by: Frank.Sebesta | last post by:
I have a wedge mag stripe reader that I swipe when ask to input information in a query. How do I filter the unwanted characters. Apparently there are two mag stripes that are read every time I...
6
by: bobbie.matera | last post by:
I have the system setup to import a DomainList.csv file into a table called tblDmnLst. It contains a column called "NitchMarket" (datatype = text 75 character) where the user has discribed the...
4
by: David Beck | last post by:
I donwnload some files for processing every day that have unwanted characters in them. In VB6 I use the InputB to read in the text and the StrConv. vLinesFromFile =...
3
by: et | last post by:
How can I strip out unwanted characters in a string before updating the database? For instance, in names & addresses in our client table, we want only letters and numbers, no punctuation. Is...
7
by: Chris Brat | last post by:
Hi, Is there a better way to replace/remove characters (specifically ' and " characters in my case, but it could be anything) in strings in a list, than this example to replace 'a' with 'b': ...
4
by: vvenk | last post by:
Hello: I have a string, "Testing_!@#$%^&*()". It may have single and double quotations as well. I would like to strip all chararcters others than a-z, A-Z, 0-9 and the comma. I came across...
6
by: cmdolcet69 | last post by:
I have a value bieng added into my array that displays correctly in the textbox as 0.10 however when i read from my array into an excel spreadsheet I get the value 0.10 how can I get rid of the ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.