Ekstrak nomor dari string
var num = txt.replace(/[^0-9]/g,'');
Disgusted Dogfish
var num = txt.replace(/[^0-9]/g,'');
String str="sdfvsdf68fsdfsf8999fsdf09";
String numberOnly= str.replaceAll("[^0-9]", "");
str = str.replaceAll("\\D+","");
// Java program to Extract Digits from A Given Integer
// Printing the last digit of the number
while (number > 0) {
// Finding the remainder (Last Digit)
int remainder = number % 10;
// Printing the remainder/current last digit
System.out.println(remainder);
// Removing the last digit/current last digit
number = number / 10;
}
A B
1 V2
3 W42
1 S03
2 T02
3 U71
df['B'] = df['B'].str.extract('(\d+)').astype(int)
B
2
42
3
2
71