- Home /
get three variables from string variable name
Hello, i have two questions : 1- i have a array and need to get three rows from it (without repeat the same row) 2-i need to convert the string to variable , to change the variable, like: public string x; "x" = "Hello"; // of course will not work , i need some another way thx
Your question is hard to understand. Try writing them again but more clearly.
PS: Ad.1. Array doesn't contain rows by themselves. It takes few assumptions but you're not mentioning them and it's confusing
Ad.2. What? Do you mean assigning new value to a variable? Like:
string x;
x = "Hello"; //will work
Answer by Mercbaker · Jul 01, 2017 at 09:24 PM
You can use a for loop or a foreach loop to iterate through an array.
for(int i = 0; i < array.length; i++){
//do something with 'array[ i ]'
}
foreach(int query in array){
//do something with 'query'
}
As for your other request I have no idea what your trying to communicate.
It sounds like you need to do a beginners tutorial for coding in general though. Your foundation logic sounds a bit confused.
Your answer

Follow this Question
Related Questions
Converting file types 1 Answer
Converting 'char' to the name of a variable 1 Answer
Easier way to remap mouse axis / keyboard input to iphone joysticks? 0 Answers
Convert To UnityScript 1 Answer
C# to Unity script question ? 4 Answers