- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
public static class EscapeSequenceChecker {
public class Result {
public bool Success;
public string UnknownEscapeSequence;
}
public static Result Check(ConstValue value) {
return Check(value.Value);
}
public unsafe static Result Check(String str) {
int length = str.Length;
char errorChar = '\0';
fixed(char* checkStr = str) {
bool success = false;
for(int i = 0; i < length; i++) {
if(checkStr[i] == SPECIAL_CHARS.PREFIX) {
if(i >= length-1) {
errorChar = '\0';
goto FAIL;
}
success = false;
int allSpecialCharsLength = SPECIAL_CHARS.ALL.Length;
for(int sc = 0; sc < allSpecialCharsLength; sc++) {
if(checkStr[i+1] == SPECIAL_CHARS.ALL[sc]) {
success = true;
break;
}
}
if(!success) {
errorChar = checkStr[i+1];
goto FAIL;
}
}
}
}
SUCCESS:
return new Result{ UnknownEscapeSequence="", Success=true };
FAIL:
return new Result{ UnknownEscapeSequence=new String(SPECIAL_CHARS.PREFIX,1) + errorChar, Success=false };
}
}
j123123 04.01.2016 00:16 # −2
bormand 10.01.2016 09:14 # +1
kegdan 10.01.2016 11:22 # +3
bormand 10.01.2016 11:29 # 0
kegdan 10.01.2016 11:42 # 0
bormand 10.01.2016 11:43 # +1
kegdan 10.01.2016 11:46 # 0
bormand 10.01.2016 11:54 # 0
yakov_255 20.01.2016 13:52 # 0
tucvbif 24.01.2016 10:13 # 0
:)
bormand 24.01.2016 10:31 # +1
COMHPiI 25.08.2021 02:32 # 0