From the course: Learning the Go Standard Library
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Basic string operations - Go Tutorial
From the course: Learning the Go Standard Library
Basic string operations
- All right. Let's start off by looking at some basic operations involving strings. So the documentation for the go strings package is located at this link. And I have it here on my browser. And if I scroll down a bit, you can see that there's a pretty fairly extensive collection of functions just within this one package. Now these are not all of the string related functions. There are some other packages that also work with strings. But this is where we'll get started. All right. So let's go ahead, back over to our code. All right. And here in the editor, I'm going to open up the basic start go file in my basic folder. So let's go ahead and uncomment our import statements. So I'm going to import FMT and strings and I'm also going to uncomment, oops, this string variable. So to calculate the length of a string or of any sequence for that matter, you can use the built-in length function. So I'm going to print out the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
The strings package1m 31s
-
(Locked)
Basic string operations7m 34s
-
(Locked)
String searching7m 13s
-
(Locked)
String manipulation9m 46s
-
(Locked)
Using the Map function6m 52s
-
(Locked)
Using string builder6m 18s
-
(Locked)
Parsing strings with strconv9m 11s
-
(Locked)
String tests with Unicode5m 16s
-
(Locked)
-
-
-
-