- Home /
Question by
donazandre · May 13, 2020 at 07:11 PM ·
c#scripting problem
Problem recognizing new line character in unity
Hi,
I'm trying to build an interpreter in unity to process input from the player.
I'm struggling with recognising a new line character to create a token also for that.
I usually used Regex.Unescape but this only works with strings, not with characters. What do you suggest?
Right now this solution isn't giving me any results:
char character = InputString[current];
if (character == '\n')
{
TempToken = new { Id = "newline", value = "newline", };
Tokens.Add(TempToken);
current++;
Debug.Log("found a new line");
continue;
}
Comment