473,883 Members | 1,956 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to double quote a variable string?

6 New Member
Hi, I'd like to know how to add double quote to a string variable. For example,
Expand|Select|Wrap|Line Numbers
  1. string filename = @"C:\my file";
  2. arguments = "-i " + filename;
So arguments = @"-i C:\my file".

But I want arguments = @"-i "C:\my file"". How to do it with filename only? I tried,
arguments = "-i " + "\"filename \"";
but only get arguments = @"-i "filename"" .

Any thought?
Feb 26 '11
11 15549
6 New Member
Thanks a lot, Plater, it is working finally.
Feb 28 '11 #11
1 New Member
This can be tried for the same issue.
string filename = @"c:\my file";
string output ="@" + "\"" + "-i\"" + filename + "\""+"\"";
Dec 4 '12 #12

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

Similar topics

by: Alden Streeter | last post by:
Here is the HTML that is being output by my asp page: <a href='Files/category/computers/bigimages/computers-sub-monitors.jpg' target='_blank' onMouseOver="window.status='Click for a larger image of MONITOR, 19\" CODAR EAGLE.';return true;" onMouseOut="window.status='';return true;"> <img width='98' height='96' border='0' src='Files/category/computers/bigimages/computers-sub-monitors.jpg' alt='MONITOR, 19" CODAR EAGLE'></a>
by: Diarmaid McGleenan | last post by:
Hi all. This isn't quite the same single/double-quote problem we see posted a multitude of times in this ng. Read on... I have a js function called ShowActiveLink which accepts a string containing the full "<a href...>" element. My problem is that some of the hrefs contain both single and double quotes and I don't have the ability to escape these characters manually because our content management system inserts the href when it generates...
by: Ahmad A. Rahman | last post by:
Hi all, I have a problem constructing a regular expression using .net. I have a string, separated with comma, and I want to group the string together but, I failed to group a numeric character with decimal values. Example string : 1, 2.3, "two"," three" So, I want to group this string into 4 groups (1), (2.3), (two) and (three)
by: ÷zden Irmak | last post by:
Hi, I've to add ( " ) double quote character to a string which I later save the string into a file? How can I add this character to a string in C#? 3 times double quote doesn't seem to work... Thanks...
by: fred | last post by:
Hi, is there a way to put " (double quote) into a verbatin string? thank you
by: Edward | last post by:
My function to populate fields on a form from a collection: Private Sub cbfSetUpAddresses(ByVal pcolAddress As Collection) Line 1 Me.txtAddress1.Text = pcolAddress(1).ToString Line 2 Me.txtAddress2.Text = pcolAddress(2).ToString Line 3 Me.txtAddress3.Text = pcolAddress(3).ToString Line 4 Me.txtAddress4.Text = pcolAddress(4).ToString Line 5 Me.txtPostCode.Text = pcolAddress(5).ToString
by: Kevin Thomas | last post by:
Hi there, If I have a string var, strFoo that contains double-quotes such that it looks like this: I "love" VB What do I pass into the "replace" method to replace the double-quotes with something else? strFoo = strFoo.replace(???,"&quot;")
by: Huy | last post by:
I've been unable to find information clarifying this but. What is the difference between 'somestring' and "somestring"? When I use type() it still reports as string. If there is a difference could someone point me to documentation or explain when to use and when not to? Hope I sound clear.
by: U Aye Thein | last post by:
I found in internet how to solve single quotation mark in string and how to solve double quotation mark in string but my string may be contained single quote or double quote. How to write an expression for my string test.
by: zacks | last post by:
I need to check the current value of a string value to see if it either starts with or ends with a double quote character, as in "123" (where the quotes are actual contens of the string). I thought a quotation character inside of a string is specified with two double quote characters. But when I code something like: string myString; if (myString.StartsWith("""")) {
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Duprť who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.