Search a String Variable with JavaScript Methods

제공자:
Coursera Project Network
학습자는 이 안내 프로젝트에서 다음을 수행하게 됩니다.

Write the JavaScript code to search through a string.

Compare JavaScript methods for searching through strings.

Use a JavaScript method to replace a value in a string.

Clock2 hours
Intermediate중급
Cloud다운로드 필요 없음
Video분할 화면 동영상
Comment Dots영어
Laptop데스크톱 전용

In this intermediate-level project you will write JavaScript code to search through a string variable. You’ll use a variety of JavaScript methods to locate values within a string to determine whether they exist, find their position in the string, or even replace them with other values. The Notepad++ editor and Chrome browser are used to write inline JavaScript code and view the results. Note: This course works best for learners who are based in the North America region. We’re currently working on providing the same experience in other regions.

개발할 기술

  • JavaScript replace()
  • Javascript Methods
  • JavaScript search()
  • Strings
  • Java Syntax

단계별 학습

작업 영역이 있는 분할 화면으로 재생되는 동영상에서 강사는 다음을 단계별로 안내합니다.

  1. Declare a JavaScript variable and assign to it a string value, while demonstrating string-handling techniques.

  2. Use the JavaScript includes() method to search through a string to determine whether it contains a string of characters.

  3. Search through a string using the JavaScript search() method with the goal of returning the position of the matching characters or set of characters.

  4. Search through a string with the JavaScript indexOf() method to return the first occurrence of a specific value.

  5. Search through a string with the JavaScript lastIndexOf() method to return the last occurrence of a specific value.

  6. Locate and replace a value in a JavaScript string using the replace() method.

안내형 프로젝트 진행 방식

작업 영역은 브라우저에 바로 로드되는 클라우드 데스크톱으로, 다운로드할 필요가 없습니다.

분할 화면 동영상에서 강사가 프로젝트를 단계별로 안내해 줍니다.

자주 묻는 질문

자주 묻는 질문

궁금한 점이 더 있으신가요? 학습자 도움말 센터를 방문해 보세요.