Strip a set of characters from a string: Difference between revisions
Content added Content deleted
(added python) |
|||
Line 20: | Line 20: | ||
let rec aux i j = |
let rec aux i j = |
||
if i >= len then String.sub res 0 j |
if i >= len then String.sub res 0 j |
||
else |
else if String.contains cs s.[i] then |
||
aux (succ i) (j) |
|||
else begin |
|||
aux (succ i) (j) |
|||
res.[j] <- s.[i]; |
|||
aux (succ i) (succ j) |
|||
end |
|||
aux (succ i) (succ j) |
|||
in |
in |
||
aux 0 0</lang> |
aux 0 0</lang> |