@xin55/strstr

strstr practice

Usage no npm install needed!

<script type="module">
  import xin55Strstr from 'https://cdn.skypack.dev/@xin55/strstr';
</script>

README

strstr practice

Description

練習使用 for loop 實現 strstr 方法

Usage

yarn add @xin55/strstr
import strstr from '@xin55/strstr'

expect(strstr('Function name is strstr', 'name')).toBe(9)
expect(strstr('Function name is strstr', 'Name')).toBe(-1)
expect(() => strstr('Function name is strstr')).toThrow(new Error('strstr should pass two string'))