Click here to Skip to main content
16,008,719 members
Home / Discussions / C#
   

C#

 
GeneralRe: Operator overloading with strings Pin
hzs12-Aug-03 1:39
hzs12-Aug-03 1:39 
GeneralRe: Operator overloading with strings Pin
Ista12-Aug-03 4:16
Ista12-Aug-03 4:16 
GeneralRe: Operator overloading with strings Pin
hzs12-Aug-03 20:09
hzs12-Aug-03 20:09 
GeneralRe: Operator overloading with strings Pin
Ista13-Aug-03 3:39
Ista13-Aug-03 3:39 
GeneralRe: Operator overloading with strings Pin
Julian Bucknall [MSFT]12-Aug-03 6:09
Julian Bucknall [MSFT]12-Aug-03 6:09 
GeneralRe: Operator overloading with strings Pin
hzs12-Aug-03 20:25
hzs12-Aug-03 20:25 
GeneralRe: Operator overloading with strings Pin
isarfraz17-Aug-03 19:53
isarfraz17-Aug-03 19:53 
GeneralRe: Operator overloading with strings Pin
Heath Stewart12-Aug-03 7:06
protectorHeath Stewart12-Aug-03 7:06 
The fact of the matter is, that unless you write your own CLR, you'll have to convert to numbers (Int32, Int64, whatever) even if you create your own class and overload the + operator - there is no way around it. All you'll be doing then, however, is making it look like you're not - it's still happening under the covers.

Using the Add(string, string) method you mentioned earlier is the best way - always modularize your code. This will allow you to use a simple, short statement to add the numeric values of the strings and will allow you to optimize the algorithm once in the future as opposed to finding all lines where you do this and change them. I recommend using a static method too, so you don't have to worry about instantiating some class just to add a couple of strings values.

 

-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
GeneralRe: Operator overloading with strings Pin
Rein Hillmann12-Aug-03 8:17
Rein Hillmann12-Aug-03 8:17 
GeneralRe: Operator overloading with strings Pin
hzs12-Aug-03 20:32
hzs12-Aug-03 20:32 
GeneralOMG I'm getting VB Script flashbacks! Pin
Furty12-Aug-03 22:32
Furty12-Aug-03 22:32 
GeneralRe: Operator overloading with strings Pin
Ista13-Aug-03 3:43
Ista13-Aug-03 3:43 
QuestionGet/Set file and dir permissions...??? Pin
vlusardi11-Aug-03 18:24
vlusardi11-Aug-03 18:24 
GeneralMath Pin
eggie511-Aug-03 16:40
eggie511-Aug-03 16:40 
GeneralRe: Math Pin
apferreira11-Aug-03 17:13
apferreira11-Aug-03 17:13 
GeneralRe: Math Pin
eggie511-Aug-03 18:11
eggie511-Aug-03 18:11 
GeneralRe: Math Pin
eggie511-Aug-03 18:25
eggie511-Aug-03 18:25 
GeneralRe: Math Pin
Philip Fitzsimons12-Aug-03 3:19
Philip Fitzsimons12-Aug-03 3:19 
GeneralForm Selection application Pin
azusakt11-Aug-03 15:30
azusakt11-Aug-03 15:30 
GeneralRe: Form Selection application Pin
Ista13-Aug-03 13:31
Ista13-Aug-03 13:31 
QuestionHow to get bimap of a form Pin
sumeat11-Aug-03 14:02
sumeat11-Aug-03 14:02 
AnswerRe: How to get bimap of a form Pin
jtmtv1811-Aug-03 14:21
jtmtv1811-Aug-03 14:21 
GeneralRe: How to get bimap of a form Pin
sumeat11-Aug-03 14:22
sumeat11-Aug-03 14:22 
GeneralHiring .Net Developers Pin
Troy Marchand11-Aug-03 12:30
sitebuilderTroy Marchand11-Aug-03 12:30 
GeneralList View in C# - 2 Quick Questions. Pin
IrishSonic11-Aug-03 11:41
IrishSonic11-Aug-03 11:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.