Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C#

Rasmus Andersen
Rasmus Andersen
1,569 Points

problem with "converting strings into integers" code challenge pls. help

I Have a problem with a code challenge

string heightInput = "168"; (and then i don't know what to write

Pls. help me or come up with your solutions

anil rahman
anil rahman
7,786 Points

When you are stuck on quizzes or challenges there is a button next to the check work called get help if you ask from there it will link the challenge you are working on also. :)

5 Answers

use it this way

string heightInput = "168"; int height = int.Parse(heightInput);

that should do it ...

Rasmus Andersen
Rasmus Andersen
1,569 Points

im new here so how do i do that

anil rahman
anil rahman
7,786 Points

String to int is normally something like this:

//declare new variable of int
//set equal to the method  Int32.Parse
//then just pass in your string variable
int x = Int32.Parse(heightInput);

int height = int.Parse(heightInput);

int height = int.Parse(heightInput); or int height = Convert.ToInt32(heightInput);