0

I am trying to do a string out of this line:

Hello "Hello" Hello

However this does not work and I beleive it has to do with "Hello".

String^ str = "Hello "Hello" Hello";
3
Contributors
6
Replies
7
Views
7 Years
Discussion Span
Last Post by thines01
0

The first double quote before the second Hello are causing the string to terminate. You can resolve this by putting single quotes instead of double quotes.

Edited by Grn Xtrm: n/a

0

okay, I am trying this example where I want the String P to be in doublemarks in String Q but dont understand how to put it, so the actual string in the end look like this:

Test"Hello"

String^ P = "Hello";

String^ Q = "Test" + ' + P + ';

Edited by Lukezzz: n/a

0

Thank you, actually no. What I am trying is to put a declared string inside double quotes exactly like as in my previous post without writing the string out like that.

/// Are you looking for THIS?
 String^ str = "Hello \"Hello\" Hello";
0

following up on the post by thines01 :
This will print the string in double quotes

string str2 = "\"Hello\"";
cout<<str2;

The output of the above code is
"Hello"

Edited by Grn Xtrm: n/a

0

Well, the closest I can see to get to that is this:

void main(void)
{
	String^ P = "Hello";
	String^ Q = "Test" + "\"" + P + "\"";

	Console::WriteLine(Q);
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.