placesbion.blogg.se

Beyond the boundary characters
Beyond the boundary characters









beyond the boundary characters

Each character in a string has a numbered position. That should create the full_name Arthur Dent.Ġ1:53 Now I’m going to have you look at indexing. So here, we’re adding first_name, " ", and last_name.

beyond the boundary characters

Well, you can do that through concatenation also.Ġ1:33 You would add the first_name to a string that has a single space ( " ") in it and then also concatenate that with last_name. That full_name, though, needs a space in the middle of it. Let’s feed it something with names.Ġ1:20 Say you had a first_name of "Arthur" and a last_name of "Dent", and you wanted to create a full_name. That will concatenate them together into abracadabra. Here in the interactive window, create the two strings by assigning "abra" to one and "cadabra" to the other, and then create a third variable, magic_string and say string1 + string2. Let’s try out some examples in the interactive window.Ġ0:55 Okay. In this example, string1, "abra", and string2, "cadabra", are tied together, or concatenated, into magic_string by assigning magic_string to string1 + string2.

beyond the boundary characters

You’re adding one string to another, and that concatenates them. To combine, or concatenate, strings, you use the + (plus) operator. In this lesson, you’re going to learn about concatenation, indexing, and slicing, three basic string operations.Ġ0:14 Concatenation joins two strings together, indexing gets a single character from a string, and slicing gets several characters from a string at once.Ġ0:26 Let’s start with concatenation. 00:00 In the previous lesson, you learned all about creating strings and writing out string literals.











Beyond the boundary characters