From the course: Grasshopper and Rhino: C# Scripting

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Strings

Strings

From the course: Grasshopper and Rhino: C# Scripting

Start my 1-month free trial

Strings

- [Instructor] Strings allow us to display and store information as letters and words. A string data type is essentially then text. It is made up of characters, which form the complete string object. Let's create some strings using C#. Go ahead and place a new C# component and open it up. We can create strings by first declaring a string variable and assigning to it a value with either single or double quotation marks surrounding it, but not a combination. Let's try this by creating a variable named word, and we'll assign to this the string, Hello Grasshopper, and then let's output that word variable. Perfect, so we have our first string output with C#. We can perform arithmetic operations on strings too, such as addition. Addition is used to join strings together and is also known as concatenation. This is done using the plus symbol. For example, let's output A equals word plus from C#, and then see what we get. Great,…

Contents