Method |
Description |
Example |
---|---|---|
AsInt(),IsInt() |
Converts a string that representsa whole number (like "93") to aninteger. |
var myIntNumber = 0;var myStringNum = "539";if(myStringNum.IsInt()==true){myIntNumber = myStringNum.AsInt();} |
AsBool(),IsBool() |
Converts a string like "true" or"false" to a Boolean type. |
var myStringBool = "True";var myVar = myStringBool.AsBool(); |
AsFloat(),IsFloat() |
Converts a string that has adecimal value like "1.3" or "7.439"to a floating-point number. |
var myStringFloat = "41.432895";var myFloatNum = myStringFloat.AsFloat(); |
AsDecimal(),IsDecimal() |
Converts a string that has adecimal value like "1.3" or "7.439"to a decimal number. |
(A decimalnumber is more precise than afloating-point number.) var myStringDec = "10317.425";var myDecNum = myStringDec.AsDecimal(); |
AsDateTime(),IsDateTime() |
Converts a string that representsa date and time value to theASP.NET DateTime type. |
var myDateString = "12/27/2010";var newDate = myDateString.AsDateTime(); |
ToString() |
Converts any other data type to astring. |
int num1 = 17;int num2 = 76;// myString is set to 1776string myString = num1.ToString() +num2.ToString(); |
ASP.NET is a development framework for building web pages and web sites with HTML, CSS, JavaScript and server scripting. ASP.NET supports three different development models: Web Pages, MVC (Model View Controller), and Web Forms.
Thursday, September 13, 2012
Classes in MVC
Subscribe to:
Post Comments (Atom)
Using Authorization with Swagger in ASP.NET Core
Create Solution like below LoginModel.cs using System.ComponentModel.DataAnnotations; namespace UsingAuthorizationWithSwagger.Models { ...
-
Output: using Microsoft.VisualBasic; using System; using System.Collections; using System.Collections.Generic; using S...
-
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.D...
-
<?xml version="1.0" encoding="utf-8"?> <Report xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting...
No comments:
Post a Comment