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

tab char in a string...

how do i get a tab char into a string? i tried this and it didn't work...
t.Question = "this is the \t\t\t first line" +
Environment.NewLine + "the \r\n second broken line";
Nov 15 '05 #1
4 46275
Chuck,

\t is the correct escape sequence for a tab.

What do you mean by, "it didn't work"? How did you display the string?

--Bob

"Chuck Bowling" <ch**********@sbcglobal-NO-SPAM.net> wrote in message
news:uP**************@TK2MSFTNGP09.phx.gbl...
how do i get a tab char into a string? i tried this and it didn't work...
t.Question = "this is the \t\t\t first line" +
Environment.NewLine + "the \r\n second broken line";

Nov 15 '05 #2
all i did to display was dump the string into a label i.e.

lblQuestion.Text = t.Question;

there were no tabs apparent in the display.
"Bob Grommes" <bo*@bobgrommes.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
Chuck,

\t is the correct escape sequence for a tab.

What do you mean by, "it didn't work"? How did you display the string?

--Bob

"Chuck Bowling" <ch**********@sbcglobal-NO-SPAM.net> wrote in message
news:uP**************@TK2MSFTNGP09.phx.gbl...
how do i get a tab char into a string? i tried this and it didn't work...

t.Question = "this is the \t\t\t first line" +
Environment.NewLine + "the \r\n second broken line";


Nov 15 '05 #3
As far as I know, the label contol doesn't display the tab character. Try a
different control, or examine the value of the variable w/ the debugger while
the program is running.

Chuck Bowling wrote:

all i did to display was dump the string into a label i.e.

lblQuestion.Text = t.Question;

there were no tabs apparent in the display.

"Bob Grommes" <bo*@bobgrommes.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
Chuck,

\t is the correct escape sequence for a tab.

What do you mean by, "it didn't work"? How did you display the string?

--Bob

"Chuck Bowling" <ch**********@sbcglobal-NO-SPAM.net> wrote in message
news:uP**************@TK2MSFTNGP09.phx.gbl...
how do i get a tab char into a string? i tried this and it didn't work...

t.Question = "this is the \t\t\t first line" +
Environment.NewLine + "the \r\n second broken line";


Nov 15 '05 #4
ah... thanks Julie..

"Julie" <ju***@aol.com> wrote in message news:40***************@aol.com...
As far as I know, the label contol doesn't display the tab character. Try a different control, or examine the value of the variable w/ the debugger while the program is running.

Chuck Bowling wrote:

all i did to display was dump the string into a label i.e.

lblQuestion.Text = t.Question;

there were no tabs apparent in the display.

"Bob Grommes" <bo*@bobgrommes.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
Chuck,

\t is the correct escape sequence for a tab.

What do you mean by, "it didn't work"? How did you display the string?
--Bob

"Chuck Bowling" <ch**********@sbcglobal-NO-SPAM.net> wrote in message
news:uP**************@TK2MSFTNGP09.phx.gbl...
> how do i get a tab char into a string? i tried this and it didn't

work...
>
>
> t.Question = "this is the \t\t\t first line" +
> Environment.NewLine + "the \r\n second broken line";
>
>

Nov 15 '05 #5

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

Similar topics

7
by: Yang Song | last post by:
HI, I am a little confused about char * and char. How would I be able to return a char* created in a function? Is new() the only way? How would I be able to return a point and a value at the same...
24
by: Norm | last post by:
Could someone explain for me what is happening here? char *string; string = new char; string = "This is the string"; cout << string << std::endl; The output contains (This the string) even...
9
by: Christopher Benson-Manica | last post by:
I need a smart char * class, that acts like a char * in all cases, but lets you do some std::string-type stuff with it. (Please don't say to use std::string - it's not an option...). This is my...
22
by: Simon | last post by:
Hi, I have written a function to trim char *, but I have been told that my way could be dangerous and that I should use memmove(...) instead. but I am not sure why my code could be 'dangerous'...
4
by: Radde | last post by:
Hi, class String { public: String(char* str); void operator char*();
2
by: Peter Nilsson | last post by:
In a post regarding toupper(), Richard Heathfield once asked me to think about what the conversion of a char to unsigned char would mean, and whether it was sensible to actually do so. And pete has...
5
by: jab3 | last post by:
(again :)) Hello everyone. I'll ask this even at risk of being accused of not researching adequately. My question (before longer reasoning) is: How does declaring (or defining, whatever) a...
8
by: andrew.fabbro | last post by:
In a different newsgroup, I was told that a function I'd written that looked like this: void myfunc (char * somestring_ptr) should instead be void myfunc (const char * somestring_ptr) ...
18
by: Pedro Pinto | last post by:
Hi there once more........ Instead of showing all the code my problem is simple. I've tried to create this function: char temp(char *string){ alterString(string); return string;
20
by: liujiaping | last post by:
I'm confused about the program below: int main(int argc, char* argv) { char str1 = "abc"; char str2 = "abc"; const char str3 = "abc"; const char str4 = "abc"; const char* str5 = "abc";
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.