---
title: 字符串相关
toc: content
---
## 代码演示
## getValueByUrl
通过 url 返回想要的参数
```js
import { getValueByUrl } from '@zhst/func'
const value = getValueByUrl('a', 'http://localhost:30058?a=123&token=asdfasdfsdf')
// --> 123
const value2 = getValueByUrl('a', '?a=123&token=asdfasdfsdf')
// --> 123
const value3 = getValueByUrl('a', 'a=123&token=asdfasdfsdf')
// --> 123
```
调试台
px 转 rem