-
Notifications
You must be signed in to change notification settings - Fork 0
/
CharsAndStrings.cs
57 lines (45 loc) · 1.25 KB
/
CharsAndStrings.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Run this code online: http://ideone.com/fork/xUWjOj
using System;
class CharsAndStrings
{
public static void Main(string[] args)
{
char slash = '\\';
char quote = '\"';
string h = "mundo";
Console.WriteLine(h); // mundo
string hseq = "\\mundo\\";
Console.WriteLine(hseq); // \mundo\
string hver = @"\\mundo\\";
Console.WriteLine(hver); // \\mundo\\
string a = h + hseq + hver;
Console.WriteLine(a);// mundo\mundo\\\mundo\\
var mundo = "\"mundo\"";
if (mundo[0] == quote)
{
Console.WriteLine("mundo [0] == quote");
}
var html =
@"
<html>
<head>
<title>Mi página web</title>
</head>
<body>
</body>
</html>
";
Console.WriteLine(html);
// TODO: Añadir uso de StringBuilder
// This example was found at http://stackoverflow.com/questions/21644658/how-to-use-stringbuilder-wisely
StringBuilder myString = new StringBuilder("123");
while (Console.ReadLine() == "a")
{
myString.Append("+PQR"); //Average loop times 4~ or more
}
myString.Append("345");
Console.WriteLine(myString.ToString());
//// Uncomment if running in Visual
//Console.ReadKey();
}
}