We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › conversion string to int
Page Index Toggle Pages: 1
conversion string to int (Read 824 times)
conversion string to int
Mar 7th, 2007, 7:32am
 
Hi,
I don't know how convert string to int?

I try:

int number = Integer.parseInt("12");
Integer _vInt = Integer.valueOf(tt);

thanks,

mar
Re: conversion string to int
Reply #1 - Mar 7th, 2007, 8:30am
 
int number = Integer.parseInt("12");

should do the job.

F
Re: conversion string to int
Reply #2 - Mar 7th, 2007, 3:15pm
 
String s = "12";
int i = int(s);

or in cases where that doesn't work:

int i = parseInt(s);
Page Index Toggle Pages: 1