473,888 Members | 1,525 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Write a string to the console window without escape characters

Sometimes I have a string variable with many escaped characters. And when I
write

?MyString

in the Immediate window, the output is done with the \n \t and similar
characteres.
Is there any simple way to write the string as normal text?

Thank you.
Nov 16 '05 #1
2 3137
A string like this:
"C:\\mydir\\myf ile.txt"

Can be passed like this instead:
@"C:\mydir\myfi le.txt"

As for tabs, line breaks and such, you will need to use their escape keys in
C#.

If you want to see the text without escape keys, you can pass the values to
a message box to debug and you will see the text as you may want to see it.

You can also create a text file log and post the string to it. Then you can
read it as you would normally see text. This is the best approach.

Rob

"Tiësto" wrote:
Sometimes I have a string variable with many escaped characters. And when I
write

?MyString

in the Immediate window, the output is done with the \n \t and similar
characteres.
Is there any simple way to write the string as normal text?

Thank you.

Nov 16 '05 #2
in windows applications I used to do that, but I have no MessageBox in Web
App, unless I add a reference to the assembly , which would be more
complicated than making a replace with notepad.
I wonder if Console.Write would work...

will try. Thnx anyway
"Rob Lykens" <Ro*******@disc ussions.microso ft.com> wrote in message
news:4A******** *************** ***********@mic rosoft.com...
A string like this:
"C:\\mydir\\myf ile.txt"

Can be passed like this instead:
@"C:\mydir\myfi le.txt"

As for tabs, line breaks and such, you will need to use their escape keys
in
C#.

If you want to see the text without escape keys, you can pass the values
to
a message box to debug and you will see the text as you may want to see
it.

You can also create a text file log and post the string to it. Then you
can
read it as you would normally see text. This is the best approach.

Rob

"Tiësto" wrote:
Sometimes I have a string variable with many escaped characters. And when
I
write

?MyString

in the Immediate window, the output is done with the \n \t and similar
characteres.
Is there any simple way to write the string as normal text?

Thank you.

Nov 16 '05 #3

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

Similar topics

43
12184
by: Dom | last post by:
can someone please help me display text in the console cout << "Testing"; in a different colour to the default one
8
14787
by: collinm | last post by:
hi we use linux and c language under bash i do echo -e \\000\\000\\000\\000\000\\001Z00\\002AA LINUX \\004 >/dev/ttyS2 that send command to a led display (alpha sign communication)
18
7208
by: Steve Litvack | last post by:
Hello, I have built an XMLDocument object instance and I get the following string when I examine the InnerXml property: <?xml version=\"1.0\"?><ROOT><UserData UserID=\"2282\"><Tag1 QID=\"55111\"><Tag2 AID=\"5511101\"></Tag2></Tag1><Tag1 QID=\"55112\"><Tag2 AID=\"5511217\"></Tag2></Tag1><Tag1 QID=\"5512282\"><Tag2 AID=\"551228206\"></Tag2></Tag1><Tag1 QID=\"55114\"><Tag2 AID=\"5511406\"></Tag2></Tag1><Tag1 QID=\"55115\"><Tag2
3
38833
by: Ryan Folstad | last post by:
Hello i have a problem with c# string handling. Hopefully someone can explain what im doing wrong. this code: string windowsdir = "c:\\windows"; string installdir ="c:\\install"; string path= String.Format("{0}\\system32\\cscript.exe {1}\\filename.vbs", windowsdir, installdir); The inspector shows:
4
7474
by: Guadala Harry | last post by:
I need to place the following into a string... How can I properly escape the % " / < and > characters? <table width="100%" border="0" cellspacing="0" cellpadding="4px" class="hfAll"></Table> Thanks.
3
1340
by: Russell Wyatt | last post by:
I have a vb class which returns a string to my C# app. I'm finding that if escape characters are included in the string the C# string becomes a @ string and the escape chars are ignored. Unfortunately I need the escape characters. Anyone know of a way I can either avoid this behaviour or to convert the @string back to a regular C# string? Russell
12
9655
by: Jeff S | last post by:
In a VB.NET code behind module, I build a string for a link that points to a JavaScript function. The two lines of code below show what is relevant. PopupLink = "javascript:PopUpWindow(" & Chr(34) & PopUpWindowTitle & Chr(34) & ", " & Chr(34) & CurrentEventDetails & ")" strTemp += "<BR><A HREF='#' onClick='" & PopupLink & "'>" & EventName & "</A><BR>" The problem I have is that when the string variables or contain a string with an...
4
2348
by: Robert | last post by:
Hello. I have tried to remove the char "\" from a string that I am building in codebehind. to be used in a script tag. I have tried adding (char)34 to the string instead of the escape character, as well as @then double quotes. when i watch the string in the command window or the watch window it has the escape character in the string allways \"
24
4873
by: garyusenet | last post by:
I'm working on a data file and can't find any common delimmiters in the file to indicate the end of one row of data and the start of the next. Rows are not on individual lines but run accross multiple lines. It would appear though that every distinct set of data starts with a 'code' that is always the 25 characters long. The text is variable however. Assuming i've read the contents of the file into the string myfile, how do i split my...
0
9800
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,...
0
10778
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 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...
0
9597
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7990
isladogs
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...
0
7148
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5819
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6014
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4642
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4245
muto222
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.