本文整理汇总了C#中System.SByte.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# SByte.ToString方法的具体用法?C# SByte.ToString怎么用?C# SByte.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.SByte
的用法示例。
在下文中一共展示了SByte.ToString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OSSByteToString
public static unsafe string OSSByteToString(SByte n, string s, CultureInfo ci)
{
if (Utilities.IsWindows)
{
NumberFormatInfo nfi = NumberFormatInfoFromLCID(LCIDFromCultureInfo(ci));
return n.ToString(s, nfi);
}
else
{
return OSNumberToStringMac(new IntPtr((void*)&n), s, ci, CFNumberType.kCFNumberSInt8Type, n);
}
}
示例2: ToMonoBigInteger
public static Mono.Math.BigInteger ToMonoBigInteger(SByte value)
{
return Mono.Math.BigInteger.Parse(value.ToString("#"));
}
示例3: ToBigInteger
public static BigInteger ToBigInteger(SByte value)
{
return BigInteger.Parse(value.ToString("#"));
}
示例4: ToSqlString
/// <summary>
/// Converts the value of the specified 8-bit signed integer to its equivalent SqlString representation.
/// </summary>
/// <param name="value">An 8-bit signed integer.</param>
/// <returns>The SqlString equivalent of the 8-bit signed integer value.</returns>
public static SqlString ToSqlString(SByte value) { return value.ToString(); }
示例5: ToSqlString
public static SqlString ToSqlString(SByte p) { return p.ToString(); }
示例6: ToSqlChars
// Nullable Types.
/// <summary>
/// Converts the value of the specified nullable 8-bit signed integer to its equivalent SqlChars representation.
/// </summary>
/// <param name="value">A nullable 8-bit signed integer.</param>
/// <returns>The equivalent SqlChars.</returns>
public static SqlChars ToSqlChars(SByte? value) { return value.HasValue ? new SqlChars(value.ToString().ToCharArray()) : SqlChars.Null; }
示例7: ToString
public static string ToString(SByte value)
{
return value.ToString(CultureInfo.InvariantCulture);
}
示例8: ToSqlChars
public static SqlChars ToSqlChars(SByte? p) { return p.HasValue? new SqlChars(p.ToString().ToCharArray()): SqlChars.Null; }
示例9: ToString
public static String ToString(SByte? p) { return p.ToString(); }
示例10: CheckSByte
public void CheckSByte(SByte value, string format)
{
var parsed = Format.Parse(format);
var formatter = new StringFormatter(pool);
formatter.Append(value, parsed);
var result = formatter.ToString();
var clrResult = value.ToString(format, CultureInfo.InvariantCulture);
Assert.Equal(clrResult, result);
}
示例11: ToSqlString
public static SqlString ToSqlString(SByte? p) { return p.HasValue? p.ToString(): SqlString.Null; }
示例12: TestToString
public Boolean TestToString(SByte testSubject) {
strLoc = "3498d";
String b1 = "";
String b2 = "";
Boolean pass = false;
Boolean excthrown = false;
Object exc1 = null;
Object exc2 = null;
try {
b1 = testSubject.ToString();
pass = true;
excthrown = false;
} catch (Exception exc) {
exc1 = exc;
pass = false;
excthrown = true;
}
try {
b2 = Convert.ToString(testSubject);
pass = pass & true;
excthrown = false;
} catch (Exception exc) {
exc2 = exc;
pass = false;
excthrown = excthrown & true;
}
if(excthrown)
if(exc1.GetType() == exc2.GetType())
return true;
else
return false;
else if(pass && b1.Equals(b2))
return true;
else
return false;
}
示例13: PosTest12
public bool PosTest12()
{
bool retVal = true;
string ActualResult;
object ObjA;
TestLibrary.TestFramework.BeginScenario("PosTest12:Concat an object of SByte");
try
{
ObjA = new SByte();
ActualResult = string.Concat(ObjA);
if (ActualResult != ObjA.ToString())
{
TestLibrary.TestFramework.LogError("023", "Concat an object of SByte ExpectResult is equel" + ObjA.ToString()+ ",ActualResult is (" + ActualResult + ")");
retVal = false;
}
}
catch (Exception e)
{
TestLibrary.TestFramework.LogError("024", "Unexpected exception" + e);
retVal = false;
}
return retVal;
}
示例14: ParseLine
private void ParseLine(string IfText, string OldText, ref SByte Value, bool Compatibility, bool Load, bool ignoreZero = true)
{
String V = Value.ToString(); ParseLine(IfText, OldText, ref V, Compatibility, Load, ignoreZero); Value = SByte.Parse(V);
}
示例15: ReadSByte
public SByte ReadSByte(string ASection, string AKey, SByte ADefault)
{
SByte X;
string Result = ReadString(ASection, AKey, ADefault.ToString());
return (SByte.TryParse(Result, out X)) ? X : ADefault;
}