Solved

syntax for replace

Posted on 2006-10-19
3
395 Views
Last Modified: 2008-03-04
can any one send me the piece of quote for the syntax
for replace one variable value entered into VB,its value should be stored

ie "Replace" method should be used i guess

i need the syntax

thanks
0
Comment
Question by:Prakashv20
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 52

Expert Comment

by:Ryan Chong
ID: 17770995
Replace(expression, find, replacewith[, start[, count[, compare]]])

Check this out:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/65e15b2c-99b6-4f82-88e7-8c657489dd34.asp
0
 
LVL 11

Accepted Solution

by:
ch2 earned 250 total points
ID: 17771002
Private Sub Form_Load()

    Dim Original As String
    Dim Search As String
    Dim Add As String
    Dim Replaced As String
   
    Original = "My dog eats apples"
    Search = "apples"
    Add = "mushrooms"
   
    Replaced = Original & Chr(13) & Replace(Original, Search, Add, 1, -1, vbTextCompare)
   
    MsgBox (Replaced)

End Sub
0
 
LVL 52

Expert Comment

by:Ryan Chong
ID: 17771007
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month7 days, 8 hours left to enroll

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question