• USA : +1 973 910 5725
  • INDIA: +91 905 291 3388
  • info@tekslate.com
  • Login

Parsing in C# .Net

 

Screenshot_16

 

In C # .net all the data types are predefined structure.

char c;

Char is a structure and c is a  structure variable.

Structure contains a collection of methods.

Structure will be stored in a stack memory.

As per above statements, every data type contains a collection of pre defined methods .

 

Screenshot_17

 

Example:- A program to point data type limits open window forms application project

(File arrrow new arrrowprojectarrrowvisual C # arrrow  window forms application)

Observations: – A window will be opened, which is called as a form

arrrowOpen Tool Box  (view  menu  Tool Box)

arrrowPlace a button on the form

arrrowCode for button click event

Private void button1_ click

{

Message Box. Show  ( Int. Max value . To String ());

Message Box. Show  ( Int. Min value . To String ());

}

Output

2147483647

-2147483648

Execute the project

 

Write line () is used to display a message in Console Application.

Message Box. Show () is used to display a message in windows form application

 

Example on Parsing

 

Screenshot_18

Open window forms application project

Place two text boxes and a button

Code for button 1 click

Note 

The value  typed in text box 1 as called as text box1 .text

Button1 arrrowClick here

 

Message box. Show  (text box 1. Text  + text box 2. Text);

Int Sal = int. parse  (text box 1. Text);

Int inc  =  int. parse  (text box 2. Text);

Int total = sal + inc;

Message Box. Show (total . to string ());

(or)

Message Box. Show (total + “”);

Execute the project

Observations

In C # , message Box . Show () is  capable to point only string

‘+’ operator is used to add numbers and to concatenate string.

10 + 20 = 30

“10” + “20” = 1020

“10” + 20 = 1020

“At TekSlate, we are trying to create high quality tutorials and articles, if you think any information is incorrect or want to add anything to the article, please feel free to get in touch with us at info@tekslate.com, we will update the article in 24 hours.”

0 Responses on Parsing in C# .Net"

    Leave a Message

    Your email address will not be published. Required fields are marked *

    Site Disclaimer, Copyright © 2016 - All Rights Reserved.

    Support


    Please leave a message and we'll get back to you soon.

    I agree to be contacted via e-mail.