467,876 Members | 1,063 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,876 developers. It's quick & easy.

can't concat more than 2 strings

Hi,
I have following line in my c# code.

string strDDEExpression="[Replace(" + strWorkArea + ",";

When I run this and check the value in strDDEExpression, I find that the
comma is missing.

Any idea?

Thanks...

-Nikhil

Nov 15 '05 #1
  • viewed: 2683
Share:
8 Replies
Hi,

It does appear on mine :
string strWorkArea = "test";

string strDDEExpression="[Replace(" + strWorkArea + ",";

therefore maybe is something in the strWorkArea string , are you sure it
does not contain a nonprintable character?

Hope this help,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Nikhil Patel" <ni********@aol.com> wrote in message
news:uR**************@TK2MSFTNGP12.phx.gbl...
Hi,
I have following line in my c# code.

string strDDEExpression="[Replace(" + strWorkArea + ",";

When I run this and check the value in strDDEExpression, I find that the
comma is missing.

Any idea?

Thanks...

-Nikhil

Nov 15 '05 #2
Nikhil,
Does strWorkArea have an embedded null char in it? A "\0"?

The debugger will truncate displaying the string at the embedded null char.

Hope this helps
Jay

"Nikhil Patel" <ni********@aol.com> wrote in message
news:uR**************@TK2MSFTNGP12.phx.gbl...
Hi,
I have following line in my c# code.

string strDDEExpression="[Replace(" + strWorkArea + ",";

When I run this and check the value in strDDEExpression, I find that the
comma is missing.

Any idea?

Thanks...

-Nikhil

Nov 15 '05 #3
Jay, Yes it does.
I need only 8 characters of the string. But the value is assigned by an
WINAPI call. So it always puts ninth character '\0'. Can I get rid of it. If
so how?

Thanks.

"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in message
news:eC**************@TK2MSFTNGP09.phx.gbl...
Nikhil,
Does strWorkArea have an embedded null char in it? A "\0"?

The debugger will truncate displaying the string at the embedded null char.
Hope this helps
Jay

"Nikhil Patel" <ni********@aol.com> wrote in message
news:uR**************@TK2MSFTNGP12.phx.gbl...
Hi,
I have following line in my c# code.

string strDDEExpression="[Replace(" + strWorkArea + ",";

When I run this and check the value in strDDEExpression, I find that the
comma is missing.

Any idea?

Thanks...

-Nikhil


Nov 15 '05 #4
Thanks all.

This is what I did and it works.
string strDDEExpression="[Replace(" +
strWorkArea.Remove(strWorkArea.Length-1,1) + ",";
"Nikhil Patel" <ni********@aol.com> wrote in message
news:uR**************@TK2MSFTNGP12.phx.gbl...
Hi,
I have following line in my c# code.

string strDDEExpression="[Replace(" + strWorkArea + ",";

When I run this and check the value in strDDEExpression, I find that the
comma is missing.

Any idea?

Thanks...

-Nikhil

Nov 15 '05 #5
How do I simulate what you have and embedd a null character in a string
using C#

I know you found the solution to your problem
"Nikhil Patel" <ni********@aol.com> wrote in message
news:uG*************@tk2msftngp13.phx.gbl...
Jay, Yes it does.
I need only 8 characters of the string. But the value is assigned by an WINAPI call. So it always puts ninth character '\0'. Can I get rid of it. If so how?

Thanks.

"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in message news:eC**************@TK2MSFTNGP09.phx.gbl...
Nikhil,
Does strWorkArea have an embedded null char in it? A "\0"?

The debugger will truncate displaying the string at the embedded null

char.

Hope this helps
Jay

"Nikhil Patel" <ni********@aol.com> wrote in message
news:uR**************@TK2MSFTNGP12.phx.gbl...
Hi,
I have following line in my c# code.

string strDDEExpression="[Replace(" + strWorkArea + ",";

When I run this and check the value in strDDEExpression, I find that the comma is missing.

Any idea?

Thanks...

-Nikhil



Nov 15 '05 #6
News VS.NET ( MS ILM ),
(what an odd name).

string s = "Hello World\0There is an embedded null char"

The '\0' causes a null char to be embedded in the string at that position.

Hope helps
Jay

"News VS.NET ( MS ILM )" <sq**********@hotmail.com> wrote in message
news:OU**************@TK2MSFTNGP09.phx.gbl...
How do I simulate what you have and embedd a null character in a string
using C#

I know you found the solution to your problem
"Nikhil Patel" <ni********@aol.com> wrote in message
news:uG*************@tk2msftngp13.phx.gbl...
Jay, Yes it does.
I need only 8 characters of the string. But the value is assigned by an
WINAPI call. So it always puts ninth character '\0'. Can I get rid of it. If
so how?

Thanks.

"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in

message
news:eC**************@TK2MSFTNGP09.phx.gbl...
Nikhil,
Does strWorkArea have an embedded null char in it? A "\0"?

The debugger will truncate displaying the string at the embedded null

char.

Hope this helps
Jay

"Nikhil Patel" <ni********@aol.com> wrote in message
news:uR**************@TK2MSFTNGP12.phx.gbl...
> Hi,
> I have following line in my c# code.
>
> string strDDEExpression="[Replace(" + strWorkArea + ",";
>
> When I run this and check the value in strDDEExpression, I find that

the > comma is missing.
>
> Any idea?
>
> Thanks...
>
> -Nikhil
>
>
>



Nov 15 '05 #7
Jay,

In the debugger I still can see the "\0"
How did the origianl poster did not see the "\0"

"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in message
news:uR*************@TK2MSFTNGP12.phx.gbl...
News VS.NET ( MS ILM ),
(what an odd name).

string s = "Hello World\0There is an embedded null char"

The '\0' causes a null char to be embedded in the string at that position.

Hope helps
Jay

"News VS.NET ( MS ILM )" <sq**********@hotmail.com> wrote in message
news:OU**************@TK2MSFTNGP09.phx.gbl...
How do I simulate what you have and embedd a null character in a string
using C#

I know you found the solution to your problem
"Nikhil Patel" <ni********@aol.com> wrote in message
news:uG*************@tk2msftngp13.phx.gbl...
Jay, Yes it does.
I need only 8 characters of the string. But the value is assigned by
an
WINAPI call. So it always puts ninth character '\0'. Can I get rid of it.
If
so how?

Thanks.

"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in

message
news:eC**************@TK2MSFTNGP09.phx.gbl...
> Nikhil,
> Does strWorkArea have an embedded null char in it? A "\0"?
>
> The debugger will truncate displaying the string at the embedded

null char.
>
> Hope this helps
> Jay
>
> "Nikhil Patel" <ni********@aol.com> wrote in message
> news:uR**************@TK2MSFTNGP12.phx.gbl...
> > Hi,
> > I have following line in my c# code.
> >
> > string strDDEExpression="[Replace(" + strWorkArea + ",";
> >
> > When I run this and check the value in strDDEExpression, I find

that the
> > comma is missing.
> >
> > Any idea?
> >
> > Thanks...
> >
> > -Nikhil
> >
> >
> >
>
>



Nov 15 '05 #8
Jay,
Followed your example:
string myStr = "123456789\0";

string strDDEExpression="[Replace(" + myStr + ",";

I still don't have the problem of not seeing ","

Thank you

"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in message
news:uR*************@TK2MSFTNGP12.phx.gbl...
News VS.NET ( MS ILM ),
(what an odd name).

string s = "Hello World\0There is an embedded null char"

The '\0' causes a null char to be embedded in the string at that position.

Hope helps
Jay

"News VS.NET ( MS ILM )" <sq**********@hotmail.com> wrote in message
news:OU**************@TK2MSFTNGP09.phx.gbl...
How do I simulate what you have and embedd a null character in a string
using C#

I know you found the solution to your problem
"Nikhil Patel" <ni********@aol.com> wrote in message
news:uG*************@tk2msftngp13.phx.gbl...
Jay, Yes it does.
I need only 8 characters of the string. But the value is assigned by
an
WINAPI call. So it always puts ninth character '\0'. Can I get rid of it.
If
so how?

Thanks.

"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in

message
news:eC**************@TK2MSFTNGP09.phx.gbl...
> Nikhil,
> Does strWorkArea have an embedded null char in it? A "\0"?
>
> The debugger will truncate displaying the string at the embedded

null char.
>
> Hope this helps
> Jay
>
> "Nikhil Patel" <ni********@aol.com> wrote in message
> news:uR**************@TK2MSFTNGP12.phx.gbl...
> > Hi,
> > I have following line in my c# code.
> >
> > string strDDEExpression="[Replace(" + strWorkArea + ",";
> >
> > When I run this and check the value in strDDEExpression, I find

that the
> > comma is missing.
> >
> > Any idea?
> >
> > Thanks...
> >
> > -Nikhil
> >
> >
> >
>
>



Nov 15 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Doug Stiers | last post: by
3 posts views Thread by Mythran | last post: by
3 posts views Thread by Mythran | last post: by
17 posts views Thread by ramadu | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.