SByte.Parse Method converts string is in a style and culture-specific format to 8-bit signed equivalent. : SByte « Data Types « VB.Net

Home
VB.Net
1.2D
2.Application
3.Class
4.Data Structure
5.Data Types
6.Database ADO.net
7.Date Time
8.Development
9.Event
10.File Directory
11.Generics
12.GUI
13.Internationalization I18N
14.Language Basics
15.LINQ
16.Network Remote
17.Reflection
18.Security
19.Thread
20.Windows Presentation Foundation
21.Windows System
22.XML
23.XML LINQ
VB.Net » Data Types » SByteScreenshots 
SByte.Parse Method converts string is in a style and culture-specific format to 8-bit signed equivalent.
 

Imports System.Globalization

Module modMain
   Public Sub Main()
      Dim byteString As String 

      byteString = " 123"
      ParseString(byteString, NumberStyles.None)
      ParseString(byteString, NumberStyles.Integer)

   End Sub

   Private Sub ParseString(value As String, style As NumberStyles)
      Dim number As SByte

      Try
         number = SByte.Parse(value, style, NumberFormatInfo.CurrentInfo)
         Console.WriteLine("SByte.Parse(""{0}"", {1})) = {2}", value, style.ToString, number)   
      Catch As Exception
         Console.WriteLine("'{0}' and {1} throw a {2}", value, style.ToString, e.GetType.Name)   
      End Try     
   End Sub
End Module

   
  
Related examples in the same category
1.Use the Sign(SByte) method to determine the sign of a SByte value and display it to the console.
2.SByte.MaxValue represents the largest possible value of SByte.
3.SByte.Parse converts string number to 8-bit signed integer.
4.SByte.Parse converts string in a culture-specific format to its 8-bit signed integer
5.SByte.Parse converts string in a style to 8-bit signed integer equivalent.
6.SByte.ToString converts its string using the specified culture-specific format information.
7.SByte.ToString converts to string representation using the specified format.
8.SByte.ToString Method converts to string using the specified format and culture-specific format information.
9.SByte.TryParse tries to convert string in a style and culture-specific format to SByte
10.SByte.TryParse tries to convert string to SByte equivalent
11.Assign SByte to Integer
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.