[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 186
  • Last Modified:

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

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
kwh3856
Asked:
kwh3856
  • 2
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
this should do:

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

Open in new window

0
 
kwh3856Author Commented:
I need answer in C# syntax.
0
 
kwh3856Author Commented:
wow!!! that was fast.  Thanks Angel.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now