what is a string ? i dont understand please help
i am learning unityScript/javaScript for the first time NO EXPERIENCE IN ANY Language i am completely new to code so i a am learning unity script and so far ive learned a lil curly braces and round brackets and dots variables functions and now i am learning variable types such as int, float, Boolean, and string,
i understand int is a round number float is a decimal number and Boolean is true or false or false
but i cant understand what is string
i understand its characters but i don't get what for
what is it used for whats the purpose what dose it do you STRING characters together for text is it a gui text type thing i just cant grasp it so please any help at all will be great but as i said i am extremely new to scripting so explain like if i was a 8 year old lol thanks in advance
Answer by doublemax · Sep 01, 2016 at 09:51 PM
Yes, as you already said, a string stores a sequence of characters that form a text, like "Hello" or "WinterStormStudios". They are used for many purposes. It could be the display of a score, displaying a players name or some text message that appears on the screen, like "You Win!".
Inside Unity there are also other occurences, e.g. as the name of an object, the tag of an object or the name of a layer. These are all strings.
A string is a variable type, a simple container for a sequence of letters, nothing more. guitext or UItext are much more complex classes that are used to display a string on screen. $$anonymous$$g. they also contain attributes how the text should be displayed, font, color, size, alignment and so on.
Answer by WinterStormStudios · Sep 01, 2016 at 10:29 PM
thank you so much @doublemax
also tell me if im on the right track to see if im really getting it
when function WereAreYou is called it grabs the text from location and noclue and dose somthing whit it ??
when function WereAreYou is called it grabs the text from location and noclue and dose somthing whit it ??
Yes, exactly. A string variable is not that different to the other types. But ins$$anonymous$$d of a number it stores a sequence of letters.
great thanks so much man for the help