Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
14
Task/Repeat-a-string/V-(Vlang)/repeat-a-string.v
Normal file
14
Task/Repeat-a-string/V-(Vlang)/repeat-a-string.v
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
// Repeat a string, in V
|
||||
// Tectonics: v run repeat-a-string.v
|
||||
module main
|
||||
import strings
|
||||
|
||||
// starts here
|
||||
pub fn main() {
|
||||
// A strings module function to repeat strings
|
||||
println(strings.repeat_string("ha", 5))
|
||||
|
||||
// Another strings module function to repeat a byte
|
||||
// This indexes the string to get the first byte of the rune array
|
||||
println(strings.repeat("*"[0], 5))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue