Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 125
  • Last Modified:

Insert a char in a string when a char is found

ok here's the simple thing: I have a string, let's say:
String = "Mywierd\nLovely\nString"
what do I need?
String = "Mywierd\n\nLovely\n\nString"
actually I have a msgbox like this and I need to save it to a file like the second one. So When I'm printing to the file I'm supposed to add \n\n for each \n.
A small and simple code would be great. I'm using:

Open CommonDialog.FileName For Output As 1#
Print #1, textbox1.text
Close #1

Thanks everyone!
0
magb
Asked:
magb
  • 2
1 Solution
 
jayeshshahCommented:
just write

Open CommonDialog.FileName For Output As 1#
Print #1, repalce(textbox1.text,"\n","\n\n")
Close #1


K'Regards

Jayesh
0
 
aelatikCommented:
Jayesh gave you the right answer, beware of the typo 'repalce', it should be 'replace'

0
 
magbAuthor Commented:
yes, it was replace :) Great really! Just what I wanted. Thanks!
0
 
magbAuthor Commented:
Sorry... points!
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now