mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
string: add map method
This commit is contained in:
@ -1354,6 +1354,10 @@ pub fn (s string) fields() []string {
|
||||
return s.replace('\t', ' ').split(' ')
|
||||
}
|
||||
|
||||
pub fn (s string) map(func fn(byte) byte) string {
|
||||
return string(s.bytes().map(func(it)))
|
||||
}
|
||||
|
||||
// Allows multi-line strings to be formatted in a way that removes white-space
|
||||
// before a delimeter. by default `|` is used.
|
||||
// Note: the delimiter has to be a byte at this time. That means surrounding
|
||||
|
Reference in New Issue
Block a user