Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem comparing strings
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00990955
Message ID:
00990976
Vues:
16
Is it Substr or Substring?

Substring is 0-based so to get the second character, you have to use this:
MyNum3.Substring(1, 1)
>Hi.
>have the following code:
>string MyNum
>MyNum = drN["num_prev"].ToString();
>.....num_prev is a character type field in a table, length 2
>
>if ( MyNum3.Substr(2,1) = "Z") .. gives a Cannot Implicitly convert a type 'string' to 'bool'
>
>Anybody any ideas of whats wrong here.
>
>regards,
>Gerard
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform