Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
meowmeowahr committed Apr 21, 2023
1 parent 03d31d1 commit 90e3e0f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
1 change: 0 additions & 1 deletion ka_pca9685.spin2
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
'' Author..... Kevin Ahr
'' Copyright (C) 2022 Kevin Ahr
'' -- see below for terms of use
'' E-mail..... meowmeowahr@gmail.com
'' Started....
'' Updated.... 28 MAY 2022
''
Expand Down
34 changes: 32 additions & 2 deletions ka_strings.spin2
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
'' Author..... Kevin Ahr
'' Copyright (c) 2022 Kevin Ahr
'' -- see below for terms of use
'' E-mail..... meowmeowahr@gmail.com
'' Started.... 27 MAY 2022
'' Updated.... 17 JUN 2022
''
'' {$P2}
''
Expand Down Expand Up @@ -40,6 +38,38 @@ pub containschar(char, str) : out | i, size
return out


pub charcount(char, str) : out | i, size

size := strsize(str)
repeat i from 0 to size
if byte[str][i] == char
out += 1

return out


pub split_str(str, p_list, sep) : c | size, seps, i, j, k, prev_sep

bytefill(p_list, 0, strsize(p_list)) ' reset data

size := strsize(str)
prev_sep := 0
j := 0
k := 0

' get seps
repeat i from 0 to size
if byte[str][i] == sep
pint(56)
repeat j from prev_sep to i - 1
byte[p_list][j] := byte[str][j]

prev_sep := i
k++


return c

pub split_str2(str, sep, p_d0, p_d1) | len, i, c, vn

bytefill(p_d0, 0, strsize(p_d0)) ' reset data
Expand Down

0 comments on commit 90e3e0f

Please sign in to comment.