.NET Decompiler with support for PDB generation, ReadyToRun, Metadata (&more) - cross-platform!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

36 lines
555 B

namespace ICSharpCode.Decompiler.Tests.TestCases.ILPretty
{
internal class SwitchOnStringNegativeCharIndex
{
public static int M(string s)
{
if (s != null)
{
int length = s.Length;
if (length == 1)
{
switch (s[-1])
{
case 'a':
return 1;
case 'b':
return 2;
case 'c':
return 3;
case 'd':
return 4;
case 'e':
return 5;
case 'f':
return 6;
case 'g':
return 7;
case 'h':
return 8;
}
}
}
return 0;
}
}
}