subject

Write a method sameDashes that takes two Strings as parameters and that returns whether or not they have dashes in the same places (returning true if they do and returning false otherwise). For example, below are four pairs of Strings of equal length that have the same pattern of dashes. Notice that the last pair has no dashes at all. string 1: "hi--there-you." "-15-389" "criminal-plan" "abc"string 2: "12--(134)-7539" "-xy-zzy" "(206)555-1384" "9.8"To be considered a match, the Strings must have exactly the same number of dashes in exactly the same positions. The Strings might be of different length. For example, the following calls should each return true:sameDashes("1st-has-more characters", "2nd-has-less")sameDashes("1st-has- less", "2nd-has-more characters")because the Strings each have two dashes and they are in the same positions. But the following calls should each return falsebecause the longer string has a third dash where the shorter string does not:sameDashes("1st-has-more-charac ters", "2nd-has-less")sameDashes("1st-has- less", "2nd-has-more-characters")

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 06:30
On early television stations, what typically filled the screen from around 11pm until 6am? test dummies test patterns tests testing colors
Answers: 1
question
Computers and Technology, 23.06.2019 10:00
Install and use wireshark program ( send back screen shots and other vital information) case project 3-2: decode a tcp segment in a wireshark capture in this chapter, you walked through tcp segment to interpret the data included in its header. in this project, you use wireshark to capture your own http messafes, examine the tcp headers, and practice interpreting the data you'll find there. 1. open wireshark and snap the window to one side of your screen. open a browser and snap that window to the other side of your screen so you can see both windows.
Answers: 2
question
Computers and Technology, 24.06.2019 02:30
How to apply the fly in effect to objects on a slide
Answers: 1
question
Computers and Technology, 24.06.2019 11:00
Under the home tab, where can a user find options to change the bullet style of an outline? in the slides group in the font group in the paragraph group in the drawing group
Answers: 1
You know the right answer?
Write a method sameDashes that takes two Strings as parameters and that returns whether or not they...
Questions
question
Chemistry, 11.03.2020 08:01
question
Mathematics, 11.03.2020 08:02
question
Geography, 11.03.2020 08:03
Questions on the website: 13722363