Ask Question

The strPhone variable should contain only numbers and no dashes (-). An error message should display if there is a dash anywhere in the variable. Which of the following statements determines whether the variable contains a dash in order to display the message?

+3
Answers (1)
  1. 4 August, 19:58
    0
    Following are the code in the Java Programming Language.

    if strPhone. Contains ("-") = True then

    Explanation:

    In the following code, we check the condition through the if conditional statement is that if the variable "strPhone" contain dashes (-) by using the "Contains () " function is equal to True then it display the message and the variable "strPhone" contains the phone numbers. So, that's why the following If statement is correct.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “The strPhone variable should contain only numbers and no dashes (-). An error message should display if there is a dash anywhere in the ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers