String Manipulation
-
Hi all, In VB.Net Dim strTemp as string strTemp = "today is " _ & " Saturday " How to do the above in C#.Net? Thanks Senthil
-
Hi all, In VB.Net Dim strTemp as string strTemp = "today is " _ & " Saturday " How to do the above in C#.Net? Thanks Senthil
If you can;t work that out, you should be doing a very basic tutorial in C#, or buying a book. string strTemp; strTemp = "today is Saturday"; strTemp = "today is " + "Saturday"; string temp = "today is Saturday, and Microsoft no longer recommends Hungarian notation"; Note, C# doesn't have the stupid rule where you need a special character to show code goes over two lines.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
If you can;t work that out, you should be doing a very basic tutorial in C#, or buying a book. string strTemp; strTemp = "today is Saturday"; strTemp = "today is " + "Saturday"; string temp = "today is Saturday, and Microsoft no longer recommends Hungarian notation"; Note, C# doesn't have the stupid rule where you need a special character to show code goes over two lines.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
Excellent reply!:-D
-
Hi all, In VB.Net Dim strTemp as string strTemp = "today is " _ & " Saturday " How to do the above in C#.Net? Thanks Senthil
And we thank mister Semi Colon for that.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google
-
If you can;t work that out, you should be doing a very basic tutorial in C#, or buying a book. string strTemp; strTemp = "today is Saturday"; strTemp = "today is " + "Saturday"; string temp = "today is Saturday, and Microsoft no longer recommends Hungarian notation"; Note, C# doesn't have the stupid rule where you need a special character to show code goes over two lines.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
Or even:
string today = "Saturday" ;
string temp = string.Format ( "Today is {0}" , today ) ; -
Or even:
string today = "Saturday" ;
string temp = string.Format ( "Today is {0}" , today ) ;Yes, using string.Format is good. Seems I've been going down that road lately :-D
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon