|
-
Sep 10th, 2005, 01:59 AM
#1
Thread Starter
Fanatic Member
"&" in vb.net ..What is the alternative in c#?
We use & in vb.net to join 2 or more strings or Objects...
What is the alternative for this in c#?
Thanks
Godwin
Help someone else with what someone helped you! 
-
Sep 10th, 2005, 02:04 AM
#2
Re: "&" in vb.net ..What is the alternative in c#?
+
eg:
VB Code:
[COLOR=Blue]string[/COLOR] str = "something " + "something else";
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
Sep 10th, 2005, 02:07 AM
#3
Thread Starter
Fanatic Member
Re: "&" in vb.net ..What is the alternative in c#?
yes I know the +..This exists in vb.net too,so same thing works here..
but,what is the substitute for &
or Maybe there is no substitute available?
Godwin
Help someone else with what someone helped you! 
-
Sep 10th, 2005, 02:10 AM
#4
Re: "&" in vb.net ..What is the alternative in c#?
no, in vb.net you can use + but most of the time it will error, because + means literally that in .NET ( ie: add together a number )
the C# equivalent of using & is + , & is used in a different manor in C#
eg:
VB Code:
if(int someInt = 0 && int SomeotherInt = 1)
{
// do something;
}
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
Sep 10th, 2005, 02:19 AM
#5
Thread Starter
Fanatic Member
Re: "&" in vb.net ..What is the alternative in c#?
Godwin
Help someone else with what someone helped you! 
-
Sep 11th, 2005, 08:29 AM
#6
Re: "&" in vb.net ..What is the alternative in c#?
&var is address of var.
var1 & var2 is bitwise AND.
var1 && var2 is logical And.
The + operator is overriden (or is it overloaded) by the string class to mean concatenate instead of add.
-
Sep 11th, 2005, 08:38 AM
#7
Thread Starter
Fanatic Member
Re: "&" in vb.net ..What is the alternative in c#?
Thanks Penegate
Godwin
Help someone else with what someone helped you! 
-
Sep 11th, 2005, 08:40 AM
#8
Re: "&" in vb.net ..What is the alternative in c#?
Have a look here for all your C# operator needs
-
Sep 11th, 2005, 03:06 PM
#9
Thread Starter
Fanatic Member
Re: "&" in vb.net ..What is the alternative in c#?
Roger that..
Looking at it now
Godwin
Help someone else with what someone helped you! 
-
Sep 12th, 2005, 05:42 AM
#10
Re: "&" in vb.net ..What is the alternative in c#?
Who's this Roger guy you keep going on about?
-
Sep 12th, 2005, 06:23 AM
#11
Thread Starter
Fanatic Member
Re: "&" in vb.net ..What is the alternative in c#?
ummm...
Affirmitive Wossname
Godwin
Help someone else with what someone helped you! 
-
Sep 12th, 2005, 06:24 AM
#12
Thread Starter
Fanatic Member
Re: "&" in vb.net ..What is the alternative in c#?
Godwin
Help someone else with what someone helped you! 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|