mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-19 12:30:32 +00:00
53 lines
No EOL
1.2 KiB
C#
53 lines
No EOL
1.2 KiB
C#
using System;
|
|
|
|
using Cosmos.IL2CPU.Plugs;
|
|
|
|
namespace Cosmos.System.Plugs.System
|
|
{
|
|
[Plug(Target = typeof(char))]
|
|
public static class CharImpl
|
|
{
|
|
public static void Cctor()
|
|
{
|
|
}
|
|
|
|
public static bool IsDigit(char aChar)
|
|
{
|
|
return (aChar >= '0' && aChar <= '9');
|
|
}
|
|
|
|
public static bool IsDigit(string aString, int aIndex)
|
|
{
|
|
if (aString == null)
|
|
{
|
|
throw new ArgumentNullException("aString");
|
|
}
|
|
|
|
if (((uint)aIndex) >= ((uint)aString.Length))
|
|
{
|
|
throw new ArgumentOutOfRangeException("aIndex");
|
|
}
|
|
|
|
char c = aString[aIndex];
|
|
return (c >= '0' && c <= '9');
|
|
}
|
|
|
|
public static string ToString(ref char aThis)
|
|
{
|
|
char[] xResult = new char[1];
|
|
xResult[0] = aThis;
|
|
return new string(xResult);
|
|
}
|
|
|
|
public static char ToUpper(char aThis)
|
|
{
|
|
// todo: properly implement Char.ToUpper()
|
|
return aThis;
|
|
}
|
|
|
|
public static bool IsWhiteSpace(char aChar)
|
|
{
|
|
return aChar == ' ' || aChar == '\t';
|
|
}
|
|
}
|
|
} |