|
@@ -1,35 +1,50 @@
|
|
-## 方法
|
|
|
|
-
|
|
|
|
-### addTrailingSlash 字符串`末尾`添加`/`
|
|
|
|
-
|
|
|
|
-```typescript
|
|
|
|
-addTrailingSlash("http://localhost:8000");
|
|
|
|
-// => http://localhost:8000/
|
|
|
|
-```
|
|
|
|
-
|
|
|
|
-| Name | Description | Type | Default |
|
|
|
|
-| ---- | ----------- | --------- | ------------ |
|
|
|
|
-| path | `--` | `string ` | `(required)` |
|
|
|
|
-
|
|
|
|
-### removeHeadingString 删除特定`开头`的`字符串`
|
|
|
|
-
|
|
|
|
-```typescript
|
|
|
|
-removeHeadingString("/api/example", "/api");
|
|
|
|
-// => /example
|
|
|
|
-```
|
|
|
|
-
|
|
|
|
-| Name | Description | Type | Default |
|
|
|
|
-| ------- | ----------- | --------- | ------------ |
|
|
|
|
-| path | `--` | `string ` | `(required)` |
|
|
|
|
-| heading | `--` | `string ` | `(required)` |
|
|
|
|
-
|
|
|
|
-### removeHeadingSlash 删除字符串`开头`的`/`
|
|
|
|
-
|
|
|
|
-```typescript
|
|
|
|
-removeHeadingSlash("/api/example");
|
|
|
|
-// => api/example
|
|
|
|
-```
|
|
|
|
-
|
|
|
|
-| Name | Description | Type | Default |
|
|
|
|
-| ---- | ----------- | --------- | ------------ |
|
|
|
|
-| path | `--` | `string ` | `(required)` |
|
|
|
|
|
|
+## 方法
|
|
|
|
+
|
|
|
|
+### addTrailingSlash 字符串`末尾`添加`/`
|
|
|
|
+
|
|
|
|
+```typescript
|
|
|
|
+addTrailingSlash("http://localhost:8000");
|
|
|
|
+// => http://localhost:8000/
|
|
|
|
+```
|
|
|
|
+
|
|
|
|
+| Name | Description | Type | Default |
|
|
|
|
+| ---- | ----------- | --------- | ------------ |
|
|
|
|
+| path | `--` | `string ` | `(required)` |
|
|
|
|
+
|
|
|
|
+### removeHeadingString 删除特定`开头`的`字符串`
|
|
|
|
+
|
|
|
|
+```typescript
|
|
|
|
+removeHeadingString("/api/example", "/api");
|
|
|
|
+// => /example
|
|
|
|
+```
|
|
|
|
+
|
|
|
|
+| Name | Description | Type | Default |
|
|
|
|
+| ------- | ----------- | --------- | ------------ |
|
|
|
|
+| path | `--` | `string ` | `(required)` |
|
|
|
|
+| heading | `--` | `string ` | `(required)` |
|
|
|
|
+
|
|
|
|
+### removeHeadingSlash 删除字符串`开头`的`/`
|
|
|
|
+
|
|
|
|
+```typescript
|
|
|
|
+removeHeadingSlash("/api/example");
|
|
|
|
+// => api/example
|
|
|
|
+```
|
|
|
|
+
|
|
|
|
+| Name | Description | Type | Default |
|
|
|
|
+| ---- | ----------- | --------- | ------------ |
|
|
|
|
+| path | `--` | `string ` | `(required)` |
|
|
|
|
+
|
|
|
|
+### 去除字符串中的 HTML 标签
|
|
|
|
+
|
|
|
|
+```typescript
|
|
|
|
+stripHtmlTags(
|
|
|
|
+ '<p>This is a <b>sample</b> text with <a href="#">HTML tags</a>.</p>',
|
|
|
|
+ 20
|
|
|
|
+);
|
|
|
|
+// => This is a sample text..
|
|
|
|
+```
|
|
|
|
+
|
|
|
|
+| Name | Description | Type | Default |
|
|
|
|
+| --------- | ----------- | --------- | ------------ |
|
|
|
|
+| input | `文本` | `string ` | `(required)` |
|
|
|
|
+| maxLength | `最大长度` | `string ` | `(required)` |
|