All Go Rust Python PHP JavaScript
Chrome Dev Summit to secure your spot in workshops, office hours and learning lounges!

How to Use Variadic Functions in Golang

Variadic Functions Tutorial with Examples in Go. Variadic Function A variadic function is one that can be called with varying numbers of arguments. The most familiar examples are fmt.Printf and its variants. package main import "fmt" func add(v...
Patcher56

How to Concatenate a List of Strings into a Single String in Python

In Python, using the str.join function is the easiest way to concatenate a list of strings into a single string Using str.join Function The str.join() method returns a string which is the concatenation of the strings in iterable. A TypeError will be...
aweis

How to Concatenate Vectors in Rust

In Rust, there are 2 ways to concatenate vectors . Using append Method The method append() moves all the elements of other into Self, leaving other empty. See the following example: fn main() { let mut a = vec![1, 2]; let mut b = vec![3, 4]...
Unused

How to Concatenate Strings in Rust

In Rust, there are 4 ways to concatenate strings. Using String.push_str Function This function actually appends a given string slice onto the end of this `String`. See the following example: fn main() { let mut s1: String = "Hello ".to_owned(...
Tomoki

How to Concatenate Two Slices in Go

In Golang, there are 2 ways to concatenate two slices.Using append Function The append built-in function appends elements to the end of a slice. You can use append function, it really simple. For example, package main import "fmt" func main(...
aweis

How to create a multiline string in Rust

In Rust, there are 4 ways to create multiple lines string.Using triple-quotes A string literal is a sequence of any Unicode characters enclosed within two U+0022 (double-quote) characters, with the exception of U+0022 itself, which must be escaped b...
Unused

How to join a slice of strings into a single string in Go

Convert Slice to String in Golang.Using strings.Join Function Converting a slice of strings to a single string is pretty easy to do in Go. The strings.Join() method is present in the standard library for this purpose, and its usage is shown below: p...
Tomoki

How to use the cat command in Linux

Concatenate FILE(s), or standard input, to standard output. The cat command (short for “concatenate”) lists the contents of files to the terminal window. This is faster than opening the file in an editor, and there’s no chance you can accidentally a...