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

Adding more translations

This commit is contained in:
Renan Muliterno Ferreira
2019-10-01 13:27:42 -03:00
committed by GitHub
parent dff76c7965
commit 80b785ab22

View File

@@ -308,25 +308,25 @@ on a new line! ""Wow!"", the masses cried";
} }
/////////////////////////////////////// ///////////////////////////////////////
// Converting Data Types And Typecasting // Convertendo Data Types e Typecasting
/////////////////////////////////////// ///////////////////////////////////////
// Converting data // Converting data
// Convert String To Integer // Converter String para Integer
// this will throw a FormatException on failure // isso vai jogar um erro FormatException quando houver falha
int.Parse("123");//returns an integer version of "123" int.Parse("123");//retorna uma verão em Integer da String "123"
// try parse will default to type default on failure // try parse vai ir por padrão para o typo default quando houver uma falha
// in this case: 0 // 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