From the course: Learning the Go Standard Library
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
String tests with Unicode - Go Tutorial
From the course: Learning the Go Standard Library
String tests with Unicode
- [Instructor] When working with strings, it's a fairly common task to check to see if a given character belongs to a particular set of characters. So for example, you might want to check if a given character is a white space character. Or if it's a punctuation character. And the Unicode package, which I have the documentation for open here in my browser at this link. Provides a nice set of convenience functions for performing these kinds of tests. And if I scroll down, you can see that there's a bunch of functions that all start with Is. And then something, right? Like, IsPunct and IsSpace and IsLetter and so on. So, what we're going to do is exercise some of these functions in our example code. And try some of them out. So let's go over to our editor. So, here in the editor I'm going to open up in the Unicode folder in the Start folder. The unicode_start. And what I'm going to do is uncomment my imports. All…
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.