Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

im kinda newbie to c++...

i have a question about strings...

i want to connect to strings...

 

i have this

 

string* str1;

 

i have this : "Joe" and "fly"

i want str1 to be equal to "Joe Fly"

 

a simple way in vbnet is.

dim str1 as string

 

str1="joe" & "fly"

how to do it in vc++net???

 

and another question...how to add new lines? (like in vbnet..Vbcrlf,or vbnewline)???

  • Leaders
Posted

i assume you are using managed C++ ( windows forms ) , here's one way...

String * str = "Joe ";
String * str1 = "Fly";
String * str2 = "\nSome stuff on a newline"; /// \n being a new line
String * result = String::Concat(str,str1,str2); /// String::Concat joins an array of strings together
MessageBox::Show(result);

Posted
i assume you are using managed C++ ( windows forms ) , here's one way...

String * str = "Joe ";
String * str1 = "Fly";
String * str2 = "\nSome stuff on a newline"; /// \n being a new line
String * result = String::Concat(str,str1,str2); /// String::Concat joins an array of strings together
MessageBox::Show(result);

 

 

10x!!!! it works...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...