- 전체
- HTML
- Web Design (웹디자인)
- XE 응용 개발
- wordpress plugin dev
- Javascript & JavaScript Application
- MEAN Stack : full stack javascript
- angular js & ionic framework
- bootstrap
- WebGL, Three.js and Babylon.js
- restful api design
- mobile web
- node.js 응용
- Cloud Service 응용
- 웹 어셈블리 개발 [WASM, WebAssembly]
- 마이크로서비스, MSA (microservice architecture)
- WebGL / WebGPU
- next.js 개발
- micro frontend (마이크로프론트앤드)
- 전자상거래/쇼핑몰
- 서버 클라우드 (aws, azure, google)
How to check whether a string contains a substring in JavaScript?
Here is a list of current possibilities:
1. (ES6) includes—go to answer (no IE support)
var string = "foo",
substring = "oo";
string.includes(substring);
2. ES5 and older indexOf
var string = "foo",
substring = "oo";
string.indexOf(substring) !== -1;
String.prototype.indexOf returns the position of the string in the other string. If not found, it will return -1.
3. search—go to answer
var string = "foo",
expr = /oo/;
string.search(expr);
4. lodash includes—go to answer
var string = "foo",
substring = "oo";
_.includes(string, substring);
5. RegExp—go to answer
var string = "foo",
expr = /oo/; // no quotes here
expr.test(string);
6. Match—go to answer
var string = "foo",
expr = /oo/;
string.match(expr);
Performance tests are showing that indexOf might be the best choice, if it comes to a point where speed matters.
[출처] https://stackoverflow.com/questions/1789945/how-to-check-whether-a-string-contains-a-substring-in-javascript
본 웹사이트는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
댓글 0
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
|---|---|---|---|---|
| 4 |
[Node.js] forever - node.js app 이 죽을경우 자동으로 재실행해주는 모듈
| 졸리운_곰 | 2017.09.26 | 635 |
| 3 |
[Node.js] proxy 환경에서 node.js 설정
| 졸리운_곰 | 2017.08.16 | 485 |
| 2 |
[Node.js] Node.js, Express, MongoDB를 이용하여 REST API 만들기
| 졸리운_곰 | 2016.06.06 | 771 |
| 1 |
Create a Web App and RESTful API Server Using the MEAN Stack
| 졸리운_곰 | 2016.06.05 | 2119 |

