June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
|
|
@ -1,14 +1,14 @@
|
|||
let rem_space str =
|
||||
let len = String.length str in
|
||||
let res = String.create len in
|
||||
let res = Bytes.create len in
|
||||
let rec aux i j =
|
||||
if i >= len
|
||||
then (String.sub res 0 j)
|
||||
then (Bytes.sub_string res 0 j)
|
||||
else match str.[i] with
|
||||
| ' ' | '\n' | '\t' | '\r' ->
|
||||
| ' ' | '\n' | '\t' | '\r' ->
|
||||
aux (i+1) (j)
|
||||
| _ ->
|
||||
res.[j] <- str.[i];
|
||||
| _ ->
|
||||
Bytes.set res j str.[i];
|
||||
aux (i+1) (j+1)
|
||||
in
|
||||
aux 0 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue