This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| string firstString = "Hello Ken"; | |
| string secondString = "Hello Samuel"; | |
| StringBuilder sb = new StringBuilder(); | |
| if ((!string.IsNullOrEmpty(firstString)) && (!string.IsNullOrEmpty(secondString))) | |
| { | |
| foreach (char iChar in firstString) | |
| { | |
| if (!sb.ToString().Contains(iChar) && secondString.Contains(iChar)) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| string one = "hamlet"; | |
| char[] a1 = one.ToCharArray(); | |
| Array.Sort(a1); | |
| string two = "amleth"; | |
| char[] a2 = two.ToCharArray(); | |
| Array.Sort(a2); | |
| bool result = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| string text = "The quick brown fox jumps over the lazy dog"; | |
| char[] characters = text.ToArray(); | |
| StringBuilder sb = new StringBuilder(); | |
| for (int i= text.Length - 1; i >= 0; i--) | |
| { | |
| sb.Append(characters[i]); | |
| } | |
| string output = sb.ToString(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <%@ Page Language="C#" %> | |
| <%foreach (string var in Request.ServerVariables) | |
| { | |
| Response.Write(var + " " + Request[var] + "<br />"); | |
| } | |
| %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT Column1, Column2, COUNT(*) AS Amount | |
| FROM TableName | |
| GROUP BY Column1, Column2 | |
| HAVING (COUNT(*) > 1) | |
| ORDER BY Column1, Column2 |