Which of the following string functions deletes a specified length of characters and inserts another set of characters at a specified starting point? A O STR B O LEN C O STUFF D O SOUNDEX
Added by Kelly S.
Close
Step 1
Step 1: The question asks for a string function that deletes a specified length of characters and inserts another set of characters at a specified starting point. Show more…
Show all steps
Your feedback will help us improve your experience
Dominador Tan and 97 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Consider the two strings A = "computer" and B = "intro". With the given string functions, write the string values to the spaces provided. Output lines should be considered independently. a) strcpy(A, B) A = b) strcat(B, A) Laann = A = c) strncat(A, B, 2); A = d) strncpy(B, A, 3); A = B =
Dominador T.
explain how to find, remove and replace parts of a string. why is it crucial that programners can mulipulate strings and if one could not work eith python what could be the challenge that programmer will face?
Nick J.
Introduction Frequently, you will have data that, instead of being numerical, is text-based. The data could be names of people, businesses, or longer-form text you would like to mine for information. While Excel is primarily designed to deal with and manipulate numbers, it also has a set of tools that help you work with text information efficiently and easily. This tutorial is designed to familiarize you with those tools in a common and easy-to-understand situation. The data has been collected in the Microsoft Excel Online file below. Open the spreadsheet and perform the required analysis to answer the questions below. Common Text Functions Functions such as PROPER, LEN, LEFT, and RIGHT allow you to clean up and parse text information that may arrive to you in a less than ideal format. Practice using these functions in cells D2:D5 using the data in column C. Name data to proper case: fill in the blank 2 Number of characters in a text string: fill in the blank 3 Find the first 4 characters of a text string: fill in the blank 4 Find the final 3 characters of a text string: fill in the blank 5 While LEFT and RIGHT are straightforward, the MID function will provide the middle portion of a text string. You just need to tell it where to begin and how many characters you want after that location. Get three characters from a text string starting on the third character: fill in the blank 6 Concatenation Concatenation is a very common task in Excel (and in many other programming languages). To concatenate means to bring or "stick" things together. A common example is to have a first name and last name and a need to bring those together for a full name. In Excel, there are several ways to concatenate text strings. The easiest is the CONCAT function. All you do is tell it which cells you want stuck together. Try doing that in cell D7. Concatenate (bring together) text strings: fill in the blank 7 However, CONCAT is very literal. It doesn't know that there should be a space between a first and last name, for example. Therefore, you need to add that space to the CONCAT function. In Excel, a blank space is represented by the " " string of characters; quote-space-quote. Add that to the CONCAT function and practice in cell D8. Concatenate (bring together) text strings adding a space, " ": fill in the blank 8 You can also concatenate by using the ampersand (&) calculation operator instead of the CONCAT function. Again, include a space represented by the " " into your formula. Practice that in cell D9. Concatenate (bring together) text strings using ampersand (&) and adding a space, " ": fill in the blank 9 Number Conversion Not all numbers should be treated as "numbers" in a dataset. For example, zip codes, phone numbers, addresses, etc., are not meant to be added, subtracted, divided, or multiplied. Adding zip codes makes no sense. Therefore, those types of data should actually be treated as text. Luckily, Excel has the TEXT function which will do that easily. The TEXT function also requires that you tell Excel how to format the result. In the case of a zip code, we want five characters: "#####" (use the quotation marks). Use the TEXT function and the "#####" formatting rule to convert the number in C10 to a text zip code in cell D10. Convert a number (like a zip code) to text: fill in the blank 10 One challenge with converting zip codes and other numbers is that some of those values start with a leading zero. For numbers, a leading zero does not mean anything. However, for a zip code, it means a lot! Therefore, when converting a zip code that is supposed to have a leading zero, a slightly different formatting is required: "0####" which instructs Excel to format the text as 0 then the four numbers. Use that formatting technique in cell D11. Convert a number (like a zip code) to text adding back the leading zero: fill in the blank 11 Searching and Splitting Sometimes you need to search for the location of the first occurrence of a character or sub-string within a larger string. A common example is to find the location of the "@" symbol in an email address so you can isolate the username of the address. In cell D12, find the location of the "@" symbol in the email address in cell C12. Search for the location of the text string "@" within an email address: fill in the blank 12 Finally, you can combine SEARCH and LEFT to isolate the username of the email address. SEARCH tells you where the "@" symbol is located and LEFT needs to know how many characters on the left you want to keep; which SEARCH can provide. Try combining SEARCH and LEFT in cell D13 to isolate the email username from cell C13. Note: there is one slight modification you will need to make to the SEARCH part of the formula to get just the username. See if you can figure it out. Split off the username from the email address. Hint: search for the @ symbol: fill in the blank 13 Text Data Cleaning and Manipulation Beginning in row 16, columns B and C contain raw names and numeric zip codes. In columns D through H, you are asked to clean and manipulate that data in specific ways. The good thing is that you only have to create formulas for the first row, then you can fill down. Enter the values for the last row below. Note: These are meant to be challenging. So just take your time and work through each column logically using trial and error if necessary. Hint: The last column for the zip code will require a nested IF function to first see if the numeric zip code is 5 or 4 characters long so you then know which formatting to apply. Proper Name First Name Last Name Short Name (First L.) New Zip Code
Ayushi S.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD