Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
OKR
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hanfeng zhang
OKR
Commits
eca57538
Commit
eca57538
authored
Sep 06, 2021
by
sixiaofeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
f78c1fda
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
index.ts
src/util/Contact/index.ts
+5
-4
No files found.
src/util/Contact/index.ts
View file @
eca57538
...
@@ -8,11 +8,12 @@ import { Staff } from '@/Interface'
...
@@ -8,11 +8,12 @@ import { Staff } from '@/Interface'
export
function
makePy
(
str
:
string
)
{
export
function
makePy
(
str
:
string
)
{
if
(
typeof
(
str
)
!=
"string"
)
{
if
(
typeof
(
str
)
!=
"string"
)
{
throw
new
Error
(
"函数makePy需要字符串类型参数!"
)
throw
new
Error
(
"函数makePy需要字符串类型参数!"
)
}
}
var
arrResult
=
new
Array
();
//保存中间结果的数组
const
newStr
=
trim
(
str
)
for
(
var
i
=
0
,
len
=
str
.
length
;
i
<
len
;
i
++
)
{
const
arrResult
=
new
Array
()
//保存中间结果的数组
for
(
let
i
=
0
,
len
=
newStr
.
length
;
i
<
len
;
i
++
)
{
//获得unicode码
//获得unicode码
var
ch
=
s
tr
.
charAt
(
i
)
const
ch
=
newS
tr
.
charAt
(
i
)
//检查该unicode码是否在处理范围之内,在则返回该码对映汉字的拼音首字母,不在则调用其它函数处理
//检查该unicode码是否在处理范围之内,在则返回该码对映汉字的拼音首字母,不在则调用其它函数处理
arrResult
.
push
(
checkCh
(
ch
))
arrResult
.
push
(
checkCh
(
ch
))
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment