473,387 Members | 1,789 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,387 software developers and data experts.

microsoft.public.dotnet.languages.csharp

I am using C# to connect to a MySQL server and I need to be able to save
a fully qualified path into a table however MySQL strips out the path
separator character "\". Is there a way in C# to replace all
occurrences of "\" with "\\" in a string?
thanks...
Mar 22 '06 #1
2 1165
string text = "my\\string";

text.Replace("\\", "\\\\");

You can also use @...

text.Replace(@"\", @"\\");

Mar 22 '06 #2
ag******@gmail.com wrote:
string text = "my\\string";

text.Replace("\\", "\\\\");

You can also use @...

text.Replace(@"\", @"\\");

thanks that did the trick......
Mar 22 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

43
by: Spare Change | last post by:
This is a recommendation to Microsoft. VB.net and c# are almost exactly equivalent. I know why Microsoft invented VB.net -- to wean old style VB6 scripters into a true OO world: .Net. But...
5
by: Fabrizio | last post by:
HI, How i can use the Microsoft.Web.UI.WebControls reference inside a web project? There is any DLL to add? Thank you, Fabrizio
86
by: Michael Adams | last post by:
I don't know if you have noticed, but it seems like Microsoft is losing interest in C#, and putting their energy into Visual Basic.NET instead. For instance, online chats by language since July...
0
by: Tom Clement | last post by:
I've run into the same bug described by shan_chennai in an earlier post (look here...
2
by: Alvo von Cossel I | last post by:
hi, in ms office, the underlined letters in the menustrip stay underlined all the time. if you dont know what i mean the ask but i havent the time to explain now. does anyone know how to do...
4
by: Abraham Andres Luna | last post by:
how can i use the DateAndTime module in my csharp code i included a using statement: using Microsoft.VisualBasic; and then called the function: DateAndTime.MonthName(1);
3
by: Gladys | last post by:
Dear newsgroup - do not reply to this e-mail address. I have just created it to avoid getting spam to my real address. Reply to the newsgroup. I am watching them all now so please reply now. ...
9
by: Mark | last post by:
Hello I am trying to set up an open file routine that will open whatever files name is passed with its correct associated application. I have done this (quite easilly) before in VBA and am able...
2
by: Tay Kai Yang | last post by:
Hi Sincerely wanting to know how to subscribe to microsoft.public.dotnet.language.csharp. I have contacted my ISP regarding the problem that I cannot access...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.