How can I convert String s="3.78 hi bye" to double c=3.78?
Same question for String s="hi 3.78 hi bye" (take only 3.78 while ignoring the text before)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use a regex to get rid of all characters that are not a digit or a
.:You should add some exception handling in case the original string is not properly formatted.