string). #11 Strings in Javascript include a method function named search() that will search for the first occurrence of any character in a search string. For example index = phrase.search(/[ .,;:’!?]/); finds the location of the first occurrence of a space or punctuation mark in the string named phase. The value of index is set to location of the character in the string or is set to -1 otherwise. We can use this function to write our own function for removing spaces and punctuation characters from a string. The algorithm for doing this task is as follows: ALGORITHM: Remove spaces and punctuation marks from a string PROCEDURE: index = phrase.search(/[ .,;:’!?]/); WHILE a space or punctuation character is not found phrase = phrase.substring(0,index) + phrase.substring(index+1,phrase.length) index = phrase.search(/[ .,;;’!?]) END WHILE Write a Javascript function strip() that takes a string as an input parameter and returns a string with all spaces and punctuation marks removed. Attach a PDF containing the source code to this function as your response to this question.
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount! Use Discount Code “Newclient” for a 15% Discount!NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.
The post strings in java script appeared first on The Nursing TermPaper.


0 comments