Browsing Category
Go
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software. Go is expressive, concise, clean, and efficient. Its concurrency mechanisms make it easy to write programs that get the most out of multicore and networked machines, while its novel type system enables flexible and modular program construction. Go compiles quickly to machine code yet has the convenience of garbage collection and the power of run-time reflection. It’s a fast, statically typed, compiled language that feels like a dynamically typed, interpreted language.
Golang String Index() | How To Find Index Of SubString In Go
Golang String Index() is an inbuilt function that returns the index of the first instance of substr in s, or -1 if substr is not present in the string. The Index() function is used to find the index value of the first instance of the given…
How To Join Strings In Golang | Go String Join() Example
Golang String Join() is an inbuilt function that concatenates the items of its first argument to create the single string. The separator string is placed between items in the resulting String—the strings.Join() method is used to merge a…
Golang String Fields() | How To Split String In Golang
Golang string Fields() is an inbuilt function that splits a string into substrings removing any space characters, including newlines. If you want to use Fields() function, then first, you have to import the strings function and then use…
How To Sort Slice In Golang | Sort Int, Float64, String in Go
Golang sort Package provides primitives for sorting slices and user-defined collections. Go sort.Ints() function sorts a slice of ints in increasing order. Golang sort.float64() function sorts a slice of float64s in increasing order…
How To Compare Two Slices In Golang With Example
Golang slice is more powerful, flexible, convenient than an array, and is a lightweight data structure. The slice is a variable-length sequence which stores elements of a similar type, you are not allowed to store different type of items in…
Golang String Contains Function | Contains() Function In Go
Golang String Contains() is an inbuilt function that checks whether substr is within the string. If you want to check if the string is a substring of another string in Go, then use Go contains() method. First, import the strings package and…
Golang Slice make() Function | How To Create Slice in Go
Golang slice make() is an inbuilt function that is used to create a slice. If you want to create dynamically-sized arrays, then use the make() function. The make() function allocates a zeroed array and returns a slice that refers to that…
Golang: How To Copy Array Into Another Array
Array in Go is a fixed-size collection of elements of the same type. The elements of the array are stored sequentially and can be accessed using their index. Golang does not provide a specific inbuilt function to copy one array into another…
Golang: How To Convert String To Int64 In Go
Golang strconv.ParseInt() is an inbuilt function that parses a decimal string (base 10) and checks if it fits into an int64. The size of an int is implementation-specific, it's either 32 or 64 bits, and that is why you won't lose any key…
Golang: How To Convert String To Rune in Go Example
Golang rune type is the alias for int32, and it is used to indicate than the integer represents the code point. ASCII defines 128 characters, identified by the code points 0–127. When you convert the string to a rune slice, you get the new…
How To Convert String To Float In Golang Example
Golang string.ParseFloat() is an inbuilt function that converts a string s to a floating-point number with a precision specified by bitSize: 32 for float32, or 64 for float64. When bitSize=32, the result still has type float64, but it will…