mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
all: updateimport ()
and []array
This commit is contained in:
parent
7b39ab6d06
commit
9f4d498ff1
59 changed files with 181 additions and 254 deletions
|
@ -22,7 +22,7 @@ fn main() {
|
|||
m[word] = m[word] + 1 // TODO m[key]++
|
||||
}
|
||||
// Sort the keys
|
||||
mut keys := m.keys()
|
||||
mut keys := m.keys()
|
||||
keys.sort()
|
||||
// Print the map
|
||||
for key in keys {
|
||||
|
@ -33,7 +33,7 @@ fn main() {
|
|||
|
||||
// Creates an array of words from a given string
|
||||
fn extract_words(contents string) []string {
|
||||
mut splitted := []string
|
||||
mut splitted := []string{}
|
||||
for space_splitted in contents.to_lower().split(' ') {
|
||||
if space_splitted.contains('\n') {
|
||||
splitted << space_splitted.split('\n')
|
||||
|
@ -43,7 +43,7 @@ fn extract_words(contents string) []string {
|
|||
}
|
||||
}
|
||||
|
||||
mut results := []string
|
||||
mut results := []string{}
|
||||
for s in splitted {
|
||||
result := filter_word(s)
|
||||
if result == '' {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue