 
 Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Karthikeya Boyini has Published 2192 Articles
 
 
							karthikeya Boyini
2K+ Views
Equals method is used in C# to compare the content of two StringBuilders.The following are our two StringBuilders −// first StringBuilder str1 = new StringBuilder(); str1.Append("Tim"); str1.Append("Tom"); str1.Append("Henry"); // second StringBuilder str2 = new StringBuilder(); str2.Append("John"); str2.Append("David"); str2.Append("Beth");Now use the Equals() method to compare both the methods −if (str1.Equals(str2)) ... Read More
 
 
							karthikeya Boyini
2K+ Views
To clear a StringBuilder, use the Clear() method.Let’s say we have set the following StringBuilder −string[] myStr = { "One", "Two", "Three", "Four" }; StringBuilder str = new StringBuilder("We will print now...").AppendLine();Now, use the Clear() method to clear the StringBuilder −str.Clear();Let us see the complete code −Example Live Demousing System; using ... Read More
 
 
							karthikeya Boyini
310 Views
Let's say our string is −StringBuilder str = new StringBuilder(); str.Append("pre");To change a character, set the value at that particular index. The following sets a character at the 3rd position −str[2] = 'o';Here is the complete code −Example Live Demousing System; using System.Text; public class Demo { public static ... Read More
 
 
							karthikeya Boyini
482 Views
As we know that with the help of UPDATE statement we can update the values in MySQL table and in the similar way we can update the values in MySQL views. The syntax of UPDATE statement would be the same except at the place of table name we have to ... Read More
 
 
							karthikeya Boyini
9K+ Views
For anagram, another string would have the same characters present in the first string, but the order of characters can be different.Here, we are checking the following two strings −string str1 = "heater"; string str2 = "reheat";Convert both the strings into character array −char[] ch1 = str1.ToLower().ToCharArray(); char[] ch2 = ... Read More
 
 
							karthikeya Boyini
1K+ Views
Set an array −int[] arr = { 89, 12, 56, 89, };Now, create a new Dictionary −var d = new Dictionary < int, int > ();Using the dictionary method ContainsKey(), find the duplicate elements in the array −foreach(var res in arr) { if (d.ContainsKey(res)) ... Read More
 
 
							karthikeya Boyini
294 Views
Firstly, set an array with values −int[] myArr = new int[] { 34, 23, 77, 67 };To get the average, firstly get the sum of array elements.Divide the sum with the length of the array and that will give you the average of the elements −int ... Read More
 
 
							karthikeya Boyini
2K+ Views
Firstly, set the Hex String −string str = "7D";Now, use the Convert.ToSByte() method to convert the Hex string to Hex number −Console.WriteLine(Convert.ToSByte(str, 16));Let us see the complete code −Example Live Demousing System; namespace Demo { public class Program { public static void Main(string[] args) { ... Read More
 
 
							karthikeya Boyini
416 Views
Heterogram for a string means the string isn’t having duplicate letters. For example −Mobile Cry LaptopLoop through each word of the string until the length of the string −for (int i = 0; i < len; i++) { if (val[str[i] - 'a'] == 0) val[str[i] - 'a'] = ... Read More
