473,401 Members | 2,139 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,401 software developers and data experts.

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
8 2814
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Doug Stiers | last post by:
Is there a downside to using string.concat? Other than a little overhead? str1 = string.concat(str1,str2) vs. str1 &= str2 It seems to me like the string class should be optimized to do this...
3
by: Mythran | last post by:
Out of curiosity, only, which is recommended for SHORT concatenation...or concatenating two or three strings that are relatively small in size? Dim a As String = "bah" Dim b As String = "bah2"...
3
by: Mythran | last post by:
Out of curiosity, only, which is recommended for SHORT concatenation...or concatenating two or three strings that are relatively small in size? Dim a As String = "bah" Dim b As String = "bah2"...
17
by: ramadu | last post by:
I know its a sin to use strings, lets skip that part... Which of these is faster and uses less memory? String.Format("SomeValue='{0}'", m_Value); or String.Concat("SomeValue='", m_Value,...
26
by: machineghost | last post by:
First off, let me just say that as someone with no DBA training whatsoever, any help I can get with this issue will be very, very much appreciated. My company recently migrated our database from...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
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,...
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...
0
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...
0
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...

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.