filmov
tv
How to extract integers from alphanumeric string in your Android App?

Показать описание
In this video it shows how one can extract or filter all the digits (integers) from any alphanumeric string/ texts.
It uses replaceAll method of the string to replace any non-numeric character with null (that is delete the non-numeric characters).
One can also convert the numerical string into int data type by using the below API:
Complete source code and other details/ steps of this video are posted in the below link:
However, the main Java code is copied below also for reference:
public class MainActivity extends AppCompatActivity {
private TextView textView;
private EditText editText;
@Override
protected void onCreate(Bundle savedInstanceState) {
}
public void buttonExtractIntegersFromString(View view){
}
}
-
It uses replaceAll method of the string to replace any non-numeric character with null (that is delete the non-numeric characters).
One can also convert the numerical string into int data type by using the below API:
Complete source code and other details/ steps of this video are posted in the below link:
However, the main Java code is copied below also for reference:
public class MainActivity extends AppCompatActivity {
private TextView textView;
private EditText editText;
@Override
protected void onCreate(Bundle savedInstanceState) {
}
public void buttonExtractIntegersFromString(View view){
}
}
-