Section courante

A propos

Section administrative du site

Convert.ToString

A chaîne de caractères
VB .NET (Visual Basic .NET) System

Syntaxe

Function ToString(ByVal value As Boolean) As String
Function ToString(ByVal value As Byte) As String
Function ToString(ByVal value As Char) As String
Function ToString(ByVal value As DateTime) As String
Function ToString(ByVal value As Decimal) As String
Function ToString(ByVal value As Double) As String
Function ToString(ByVal value As Short) As String
Function ToString(ByVal value As Integer) As String
Function ToString(ByVal value As Long) As String
Function ToString(ByVal value As Object) As String
Function ToString(ByVal value As SByte) As String
Function ToString(ByVal value As Single) As String
Function ToString(ByVal value As String) As String
Function ToString(ByVal value As UInt16) As String
Function ToString(ByVal value As UInt32) As String
Function ToString(ByVal value As UInt64) As String
Function ToString(ByVal value As Boolean, ByVal provider As IFormatProvider) As String
Function ToString(ByVal value As Byte, ByVal provider As IFormatProvider) As String
Function ToString(ByVal value As Byte, ByVal toBase As Integer) As String
Function ToString(ByVal value As Char, ByVal provider As IFormatProvider) As String
Function ToString(ByVal value As DateTime, ByVal provider As IFormatProvider) As String
Function ToString(ByVal value As Decimal, ByVal provider As IFormatProvider) As String
Function ToString(ByVal value As Double, ByVal provider As IFormatProvider) As String
Function ToString(ByVal value As Short, ByVal provider As IFormatProvider) As String
Function ToString(ByVal value As Short, ByVal toBase As Integer) As String
Function ToString(ByVal value As Integer, ByVal provider As IFormatProvider) As String
Function ToString(ByVal value As Integer, ByVal toBase As Integer) As String
Function ToString(ByVal value As Long, ByVal toBase As Integer) As String
Function ToString(ByVal value As Object, ByVal provider As IFormatProvider) As String
Function ToString(ByVal value As SByte, ByVal provider As IFormatProvider) As String
Function ToString(ByVal value As Single, ByVal provider As IFormatProvider) As String
Function ToString(ByVal value As String, ByVal provider As IFormatProvider) As String
Function ToString(ByVal value As UInt16, ByVal provider As IFormatProvider) As String
Function ToString(ByVal value As UInt32, ByVal provider As IFormatProvider) As String
Function ToString(ByVal value As UInt64, ByVal provider As IFormatProvider) As String

Paramètres

Nom Description
value Ce paramètre permet d'indiquer l'expression à traiter
toBase Ce paramètre permet d'indiquer la base numérique (binaire, octal, décimal, hexadécimal,...)
provider Ce paramètre permet d'indiquer le format

Description

Cette méthode permet de convertir la valeur spécifié en chaine de caractères.

Exemple

Voici un exemple d'une utilisation typique de cette méthode :

  1. Module Module1
  2.  
  3.     Sub Main()
  4.         Console.WriteLine("2010 = " & Convert.ToString(2010))
  5.         Console.WriteLine("ABC = " & Convert.ToString("ABC"))
  6.         Console.WriteLine("01-01-2000= " & Convert.ToString(#1/1/2000#))
  7.     End Sub
  8.  
  9. End Module

on obtiendra le résultat suivant :

2010 = 2010
ABC = ABC
01-01-2000= 2000-01-01 00:00:00


Dernière mise à jour : Dimanche, le 9 novembre 2014