UnionRings ♪
UnionRings ♪
CC#
Created by UnionRings ♪ on 6/17/2023 in #help
❔ Determine what variable is being referenced
That works I'll bear that in mind if this comes up again
15 replies
CC#
Created by UnionRings ♪ on 6/17/2023 in #help
❔ Determine what variable is being referenced
Oh sick
15 replies
CC#
Created by UnionRings ♪ on 6/17/2023 in #help
❔ Determine what variable is being referenced
I was moreso curious if there was a way to overcome that limitation of C# references, but if it really is as simple as "there isn't one" then ah well I can always import some dll function if I need to
15 replies
CC#
Created by UnionRings ♪ on 6/17/2023 in #help
❔ Determine what variable is being referenced
That'd definitely be better than the looping approach
15 replies
CC#
Created by UnionRings ♪ on 6/17/2023 in #help
❔ Determine what variable is being referenced
It saves a few branches
15 replies
CC#
Created by UnionRings ♪ on 6/17/2023 in #help
❔ Determine what variable is being referenced
I know there are other ways to go about it but trying to implement it this way just begged the question
15 replies
CC#
Created by UnionRings ♪ on 6/17/2023 in #help
❔ Determine what variable is being referenced
Something to this effect
int spaceCount = 0;
int leftIndex = 0;
int rightIndex;
ref int currentIndex = ref leftIndex;

while (currentIndex < str.Length)
{
if (!str[currentIndex].Equals(' '))
{
currentIndex++;
continue;
}
if (spaceCount.Equals(fieldId))
{
if (???) break;
rightIndex = leftIndex;
currentIndex = ref rightIndex;
}
spaceCount++;
currentIndex++;
}
int spaceCount = 0;
int leftIndex = 0;
int rightIndex;
ref int currentIndex = ref leftIndex;

while (currentIndex < str.Length)
{
if (!str[currentIndex].Equals(' '))
{
currentIndex++;
continue;
}
if (spaceCount.Equals(fieldId))
{
if (???) break;
rightIndex = leftIndex;
currentIndex = ref rightIndex;
}
spaceCount++;
currentIndex++;
}
15 replies
CC#
Created by UnionRings ♪ on 6/17/2023 in #help
❔ Determine what variable is being referenced
I've got a function that finds the nth space in a string and the space after that so I can underline a word in a console output. When it finds the nth space, it stores the index in one variable and switches to the second variable
15 replies