String to Int

From: Richard Blewett [DevelopMentor] (richardb_at_develop.com)
Date: 09/20/04


To: microsoft.public.dotnet.languages.csharp
Date: Mon, 20 Sep 2004 11:59:23 -0700

int.Parse("42");

 You have to think about "what would provide the functionality?" to know where to look as there are no global functions. So what would know what an int is meant to look like as a string? An int! :-)

 Regards

 Richard Blewett - DevelopMentor

 http://staff.develop.com/richardb/weblog

   nntp://news.microsoft.com/microsoft.public.dotnet.languages.csharp/>

 Kind of a newbie question, but I need to be able to convert a string to
 an integer in C#, similar to VB's Val(). Anybody know how to do this?
 I've tried C-style casting (obviously to no avail).
 
 ---
 Incoming mail is certified Virus Free.
 Checked by AVG anti-virus system (
http://www.grisoft.com).
 Version: 6.0.766 / Virus Database: 513 - Release Date: 17/09/2004

 
 [microsoft.public.dotnet.languages.csharp]



Relevant Pages

  • Re: Constant Hashcode
    ... You also have the fairly major stumbling block that string is sealed so you'd have to use encapsulation and delegation instead. ... Regards ... Richard Blewett - DevelopMentor ...
    (microsoft.public.dotnet.languages.csharp)
  • string array
    ... private string[] GetInitializedStringArray ... Richard Blewett - DevelopMentor ... How do you create a string array and initialize it with * ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: How to convert from string to stringbuilder?
    ... Regards ... Richard Blewett - DevelopMentor ... When having a string that is defined as a stringbuilder it can be converted ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Proper way to input a dynamically-allocated string
    ... > I know it must sound like a newbie question, but I never really had to ... > array of char that's dynamically allocated. ... Every string container must have a ... for a really correct and useful solution you have to roll your ...
    (comp.lang.c)
  • Re: Hi
    ... Regards ... Richard Blewett - DevelopMentor ... Checked by AVG anti-virus system. ...
    (microsoft.public.dotnet.languages.csharp)