Skip to content
Snippets Groups Projects
Commit 45a7f8a6 authored by Andrew E. Torda's avatar Andrew E. Torda
Browse files

Getting ready for being able to turn off csv output. Changes necessary

for empty strings.
parent fac9d137
No related branches found
No related tags found
No related merge requests found
package ackwork
var SetSuffix = setSuffix
var RemoveQuotes = removeQuotes
......@@ -35,3 +35,16 @@ func setSuffix(fname, suffix string) (string, error) {
return fname[0:len(fname)-len(oldExt)] + suffix, nil
}
}
// removeQuotes removes leading and trailing quotes from a string.
// We do not check for single, unmatched quotes. If you want a file
// called "fname you should use some other program.
func removeQuotes (s string) string {
for ; len(s) > 0 && s[0] == '"' ;{
s = s[1:]
}
for ; len(s) > 0 && s[len(s)-1] == '"' ; {
s = s[:len(s)-1]
}
return s
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment