mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
refactor: update memo tags
This commit is contained in:
@ -61,3 +61,13 @@ func RandomString(n int) (string, error) {
|
||||
}
|
||||
return sb.String(), nil
|
||||
}
|
||||
|
||||
// ReplaceString replaces all occurrences of old in slice with new.
|
||||
func ReplaceString(slice []string, old, new string) []string {
|
||||
for i, s := range slice {
|
||||
if s == old {
|
||||
slice[i] = new
|
||||
}
|
||||
}
|
||||
return slice
|
||||
}
|
||||
|
Reference in New Issue
Block a user