blob: 84f80ab3dd575809ff262c0b3b80e03d71c0ec72 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
// Copyright © 2020 rsiddharth <s@ricketyspace.net>
// SPDX-License-Identifier: ISC
package lib
func FillStr(a string, l int) string {
b := ""
if l < 1 {
return b
}
for i := 0; i < l; i++ {
b += a
}
return b
}
// Strip space and newline characters from string.
func stripSpaceChars(s string) string {
ss := ""
for i := 0; i < len(s); i++ {
if s[i] == ' ' {
continue
}
if s[i] == '\n' {
continue
}
ss += string(s[i])
}
return ss
}
|