ciąg do int java
String number = "10";
int result = Integer.parseInt(number);
System.out.println(result);
Copy
Tame Thrush
String number = "10";
int result = Integer.parseInt(number);
System.out.println(result);
Copy
String year = "2022";
int a = Integer.parseInt(year);
var text = '42px';
var integer = parseInt(text, 10);
// returns 42
int i=Integer.parseInt("200");
num = '10'
# check and print type num variable
print(type(num))
# convert the num into string
converted_num = int(num)
# print type of converted_num
print(type(converted_num))
# We can check by doing some mathematical operations
print(converted_num + 20)
String <string-name> = "<string-text-here>";
int <int-variable-name> = Integer.parseInt(<string>);