Replace triple quotes to single quote >> vb.net
Replace triple quotes to single quote >> vb.net
(OP)
Hi -
In a small journal I'm playing around on how to replace some """ in a text file , which contains some words surrounding three quotes on each side of these words...
I want to remove two of the quotes on each side of all words in txt file ....
Ex. """MyName""" >>>> "MyName"
I need a little help on syntax ....
I have tried the Vb . Replace function, but seeems a little tricky because it is quotes..
Regard lklo
In a small journal I'm playing around on how to replace some """ in a text file , which contains some words surrounding three quotes on each side of these words...
I want to remove two of the quotes on each side of all words in txt file ....
Ex. """MyName""" >>>> "MyName"
I need a little help on syntax ....
I have tried the Vb . Replace function, but seeems a little tricky because it is quotes..
Regard lklo





RE: Replace triple quotes to single quote >> vb.net
CODE
If you want to strip out the double quotes so that they do not appear in the string value, there are multiple ways to do it; below are two:
CODE
Option Strict Off Imports System Imports NXOpen Module Module75 Dim theSession As Session = Session.GetSession() Dim lw As ListingWindow = theSession.ListingWindow Sub Main() lw.Open() Dim strInput As String = """MyName""" lw.WriteLine("strInput: " & strInput) Dim strOutput As String strOutput = strInput.Replace("""", "") 'chr(34) = " 'alternatively, you can replace chr(34) with an empty string 'strOutput = strInput.Replace(Chr(34), "") lw.WriteLine("strOutput: " & strOutput) lw.Close() End Sub End Modulewww.nxjournaling.com