Convert To a Datatype

The CONVERT class contains the following Methods:

ToBytes()
Sample HOW TO Use Convert to Bytes:
ncTools.CONVERT.ToBytes("apple,pears");
ToDate()
Sample HOW TO Use Convert to Date:
ncTools.CONVERT.ToDate("10/1/2021"); 
 10/1/2021
ToDecimal()
Sample HOW TO Use Convert to Decimal:
ncTools.CONVERT.ToDecimal("120.87680"); 
 120.87680 
If the input string is not numeric then the result value will be zero instead of null

ToFloat()
Sample HOW TO Use Convert to Float:
ncTools.CONVERT.ToFloat("110.00"); 
110 
If the input string is not numeric then the result value will be zero instead of null.

ToGuid()
Sample HOW TO Use Convert to Guid:
ncTools.CONVERT.ToGuid("asd908a09a808sa8974238787ds97"); 
 00000000-0000-0000-0000-000000000000
ToInteger()
Sample HOW TO Use Convert to Integer:
ncTools.CONVERT.ToInteger("90"); 
Result: 90 
If the input string is not numeric then the result value will be zero instead of null.
ToNumeric()
Sample HOW TO Use Convert to Numeric:
ncTools.CONVERT.ToNumberic("120.01"); 
 120.01 
If the input string is not numeric then the result value will be zero instead of null.
ToTime()
Sample HOW TO Use Convert to Time:
ncTools.CONVERT.ToTime("8:15 AM").ToString(); 
 08:15:00

Download the ncTools Library ncTools.zip

Add Feedback