Click here to Skip to main content
15,884,636 members
Home / Discussions / C#
   

C#

 
QuestionPassing a variable from an string to a For loop Pin
Alex Dunlop11-Aug-21 23:55
Alex Dunlop11-Aug-21 23:55 
AnswerRe: Passing a variable from an string to a For loop Pin
Pete O'Hanlon12-Aug-21 2:28
mvePete O'Hanlon12-Aug-21 2:28 
GeneralRe: Passing a variable from an string to a For loop Pin
harold aptroot12-Aug-21 2:42
harold aptroot12-Aug-21 2:42 
AnswerRe: Passing a variable from an string to a For loop Pin
Richard Deeming12-Aug-21 2:48
mveRichard Deeming12-Aug-21 2:48 
AnswerRe: Passing a variable from an string to a For loop Pin
jsc4212-Aug-21 3:08
professionaljsc4212-Aug-21 3:08 
AnswerRe: Passing a variable from an string to a For loop Pin
Dave Kreskowiak12-Aug-21 3:32
mveDave Kreskowiak12-Aug-21 3:32 
AnswerRe: Passing a variable from an string to a For loop Pin
Gerry Schmitz12-Aug-21 4:13
mveGerry Schmitz12-Aug-21 4:13 
AnswerRe: Passing a variable from an string to a For loop Pin
OriginalGriff12-Aug-21 4:20
mveOriginalGriff12-Aug-21 4:20 
You can't: a string does not allow you to access variables, it's just a sequence of characters and compilation is well and truly over by the time it gets a value at all!

It might be possible to access some class level fields by using reflection, but even then, you couldn't just pass Reflection a string containing two variables and two array indexes and expect it to give you the value.

I don't know why you think you need this, but I'd suggest that you have over thought this code and are going down entirely the wrong route ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!

GeneralRe: Passing a variable from an string to a For loop Pin
Alex Dunlop12-Aug-21 6:16
Alex Dunlop12-Aug-21 6:16 
GeneralRe: Passing a variable from an string to a For loop Pin
OriginalGriff12-Aug-21 6:36
mveOriginalGriff12-Aug-21 6:36 
GeneralRe: Passing a variable from an string to a For loop Pin
Alex Dunlop12-Aug-21 8:55
Alex Dunlop12-Aug-21 8:55 
GeneralRe: Passing a variable from an string to a For loop Pin
OriginalGriff12-Aug-21 22:49
mveOriginalGriff12-Aug-21 22:49 
GeneralRe: Passing a variable from an string to a For loop Pin
Alex Dunlop13-Aug-21 7:26
Alex Dunlop13-Aug-21 7:26 
GeneralRe: Passing a variable from an string to a For loop Pin
Alex Dunlop13-Aug-21 7:31
Alex Dunlop13-Aug-21 7:31 
GeneralRe: Passing a variable from an string to a For loop Pin
OriginalGriff14-Aug-21 1:35
mveOriginalGriff14-Aug-21 1:35 
GeneralRe: Passing a variable from an string to a For loop Pin
Alex Dunlop13-Aug-21 7:39
Alex Dunlop13-Aug-21 7:39 
QuestionHow to split an string and remove extra spaces Pin
Alex Dunlop10-Aug-21 22:55
Alex Dunlop10-Aug-21 22:55 
AnswerRe: How to split an string and remove extra spaces Pin
Richard MacCutchan10-Aug-21 23:39
mveRichard MacCutchan10-Aug-21 23:39 
AnswerRe: How to split an string and remove extra spaces Pin
Pete O'Hanlon11-Aug-21 7:33
mvePete O'Hanlon11-Aug-21 7:33 
GeneralRe: How to split an string and remove extra spaces Pin
OriginalGriff11-Aug-21 7:58
mveOriginalGriff11-Aug-21 7:58 
QuestionLinq To SQL Join Question Pin
Kevin Marois9-Aug-21 6:35
professionalKevin Marois9-Aug-21 6:35 
AnswerRe: Linq To SQL Join Question Pin
Richard Deeming9-Aug-21 21:03
mveRichard Deeming9-Aug-21 21:03 
GeneralRe: Linq To SQL Join Question Pin
Nathan Minier10-Aug-21 5:46
professionalNathan Minier10-Aug-21 5:46 
QuestionHow to check Persian date format? Pin
Alex Dunlop7-Aug-21 20:19
Alex Dunlop7-Aug-21 20:19 
AnswerRe: How to check Persian date format? Pin
OriginalGriff7-Aug-21 20:22
mveOriginalGriff7-Aug-21 20:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.