1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
artcher [175]
3 years ago
12

The following method public String removeFromString(String old, String frag) removes all occurences of the string frag from the

string old. For example, removeFromString("hello there!", "he") returns "llo tre!" removeFromString("lalalala", "l") returns "aaaa" Which of the following blocks of code will successfully implement removeFromString()?
Computers and Technology
1 answer:
Mashutka [201]3 years ago
4 0

private static String removeFromString(String old, String frag)

{

int i = old.indexOf(frag);

while (i> -1) {

String rest = old.substring(i + frag.length());

System.out.println("rest = " + rest);

old = old.substring(0, i);

System.out.println("rest = " + old);

old = old + rest;

System.out.println("rest = " + old);

i = old.indexOf(frag);

System.out.println("i = "+ i);

}

return old;

}

Here the index of first occurrence is obtained outside the “while loop” and if this loop runs until index value is >-1. It extracts the rest of the characters other than “frag” from the index and all the characters for which the given set of characters are removed.

You might be interested in
Explain what qualifies a device to be called a computerized system​
Karolina [17]

Answer; A peripheral is a “device that is used to put information into or get information out of the computer.”[1]

There are three different types of peripherals:

Input, used to interact with, or send data to the computer (mouse, keyboards, etc.)

Output, which provides output to the user from the computer (monitors, printers, etc.)

Storage, which stores data processed by the computer (hard drives, flash drives, etc.)

Explanation:

7 0
3 years ago
What needs to be true of data used in consolidation
Dahasolnce [82]

Data consolidation is a collection and integration of data from multiple sources into a single destination.

Explanation:

Data consolidation allows you collect all your datas together from seperate worksheet into a master worksheet. Its function is to take data from a series of worksheet or workbooks and summaries it into a worksheet that can be updated easily.

During the process of data consolidation the different data sources are gathered together or consolidated into a single data source.

To consolidate first step is to open all files that contains data then ensure that data is organized in the same way and the third step is on the data ribbons select data tools and then consolidate. In the final step select the method of consolidation .

Consolidation is important strategically as the company looks to grow important share and market.

5 0
3 years ago
NAME THE FOUNDER OF APPLE?
larisa [96]

Answer:

Steve Jobs

Explanation:

5 0
3 years ago
Read 2 more answers
Critical Thinking Questions
Pani-rosa [81]

Answer:

Explanation:

1) Assassins Creed Valhalla. The developers (ubisoft?) is canadian i think. The culture of ACV is of the vikings. Some advantages would be many people could learn about viking culture but some concerns is since it may not be the developers culture some information could be wrong and many people could be misinformed

2) personally i would put them in the order of Asteroid, Pac Man, then modern warfare.

this is all i really know sorry

but i hope this helps <3

8 0
3 years ago
Read 2 more answers
The ________ is made up of a series of tabs that organize the various buttons, drop-down lists, and galleries of options by a br
Nina [5.8K]

Answer:

ribbon

Explanation:

Ribbon is the space at the top of the programs like excel and word, where we can find a lot of options to do in our presentations, this ribbon is divided in other categories where we can find specific options like font, number, and styles, this options was implemented from 2007 and is still used today, in addition we can modify and add other components at the ribbon

8 0
3 years ago
Other questions:
  • You need to perform maintenance on a router and need to temporarily reroute traffic through another office. which would be the b
    6·1 answer
  • ISDN stands for Internet Services Dynamic Network True/False
    6·1 answer
  • Without a well-designed, accurate database, executives, managers, and others do not have access to the ____________________ they
    15·1 answer
  • In Florida, no-fault insurance is
    7·1 answer
  • You typed the word "weather" when you meant to type the word "whether." When will Writer or Word flag this as a misspelling or a
    6·2 answers
  • Good business ethics is a good marketing strategy. Discuss
    13·1 answer
  • Round 74,361 to the nearest 10​
    6·1 answer
  • Explain why the computer is powerful working tool???​
    7·1 answer
  • Complete the sentence.<br> Python is a_____<br> level language compared to bytecode.
    7·2 answers
  • ____ uses a computer to design and test new products and modify existing ones. Computer-aided manufacturing Just-in-time design
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!