1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-21 14:02:02 +02:00

Merge pull request #3655 from rmuliterno/patch-1

Adding more translations
This commit is contained in:
Divay Prakash
2019-11-24 12:28:16 +05:30
committed by GitHub

View File

@@ -310,25 +310,26 @@ on a new line! ""Wow!"", the masses cried";
} }
/////////////////////////////////////// ///////////////////////////////////////
// Converting Data Types And Typecasting // Convertendo Data Types e Typecasting
/////////////////////////////////////// ///////////////////////////////////////
// Convertendo dados // Convertendo dados
// Converter String para Integer // Converter String para Integer
// isso lançará uma exceção "FormatException"
int.Parse("123");//returns an integer version of "123"
// try parse will default to type default on failure // isso vai jogar um erro FormatException quando houver falha
// in this case: 0 int.Parse("123");//retorna uma verão em Integer da String "123"
// try parse vai ir por padrão para o typo default quando houver uma falha
// nesse caso: 0
int tryInt; int tryInt;
if (int.TryParse("123", out tryInt)) // Function is boolean if (int.TryParse("123", out tryInt)) // Função booleana
Console.WriteLine(tryInt); // 123 Console.WriteLine(tryInt); // 123
// Convert Integer To String // Converter Integer para String
// Convert class has a number of methods to facilitate conversions // A classe Convert possuí métodos para facilitar as conversões
Convert.ToString(123); Convert.ToString(123);
// or // ou
tryInt.ToString(); tryInt.ToString();
// Casting // Casting