Solved

What is the easiest way to convert a string to a value

Posted on 2008-09-30
3
179 Views
Last Modified: 2012-05-05
If I have a string called zip and I want to convert it to a value, what is the easiest way to do this.

Example

string zip;
zip = "12345"

int x;
x = val(zip)----------------------------something like that????



0
Comment
Question by:kwh3856
  • 2
3 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 22608155
this should do:

string zip;
zip = "12345" 
int x = int.Parse(zip);

Open in new window

0
 

Author Comment

by:kwh3856
ID: 22608158
I need answer in C# syntax.
0
 

Author Closing Comment

by:kwh3856
ID: 31501665
wow!!! that was fast.  Thanks Angel.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question