+ 2
NEED HELP String to int
I need to transfer the user input (String) into integers. The input is a date (mmdd). I want two numbers so I can calculate something with them. But I don't know how I get these in 2 ints.
5 Answers
+ 6
public class Program
{
public static void main(String[] args) {
int x = Integer.parseInt("9988")/100;
int y = Integer.parseInt("9988")%100;
System.out.println(x);
System.out.println(y);
}
}
+ 4
@Selty Glad to hear that
+ 2
Thank you this helps me a lot :)
+ 1
The code I used this for is now public!
pls take a look :)
https://code.sololearn.com/c4J2WMdT3Mv6/?ref=app