Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Articles by Chandu yadav
Page 14 of 81
Bootstrap Filter list
To create a filter list, use the .list-group class in Bootstrap.You can try to run the following code to create a filter list −Example Bootstrap Example Tutorials Java jQuery PHP AngularJS Ruby C $(document).ready(function(){ $("#demo").on("keyup", function() { var value = $(this).val().toLowerCase(); $("#newList li").filter(function() { $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1) }); }); });
Read MoreSet 6-item tuple in C#’
With C#, you can easily set a 6-item tuple.The following is a 6-item tuple −var myTuple = new Tuple("electronics", new string[] { "shoes", "clothing#", "accessories" }, 100, 250, 500, 1000);above, we have tuple for string, string array and int as shown below −TupleHere is the complete code −Exampleusing System; class Demo { static void Main() { var myTuple = new Tuple("electronics", new string[] { "shoes", "clothing#", "accessories" }, 100, 250, 500, 1000); // Displaying Item 1 Console.WriteLine(myTuple.Item1); // Displaying Item 5 Console.WriteLine(myTuple.Item5); // Displaying Item 6 Console.WriteLine(myTuple.Item6); } }Outputelectronics 500 1000
Read MoreWhat does the @ prefix do on string literals in C#?
The @prefix states hat you don't need to escape special characters in the string following to the symbol.The following statement@"D:ew"is equal to:"D:ew"The @ prefix is also used if you want to have large strings and want it to be displayed across multiple lines. The following is an example showing multi-line string −Exampleusing System; namespace Demo { class Program { static void Main(string[] args) { string str = @"Welcome User, Kindly wait for the image to load"; Console.WriteLine(str); } } }OutputWelcome User, Kindly wait for the image to load
Read MoreC# program to get the file name in C#
Set the path name in a string −string myPath = "D:ew\quiz.txt";Now, use the GetFileName() method to get the name of the file −Path.GetFileName(myPath)The following is the complete code −Exampleusing System; using System.IO; namespace Demo { class Program { static void Main(string[] args) { string myPath = "D:ew\quiz.txt"; // get extension Console.WriteLine("Extension: "+Path.GetExtension(myPath)); // get path Console.WriteLine("File Path: "+Path.GetFileName(myPath)); } } }OutputExtension: .txt File Path: D:ew\quiz.txt
Read MoreAdd a red background color to an element to set danger action with Bootstrap
Use the .btn-danger class to set danger action for a button i.e. red background color to an element.You can try to run the following code to implement danger action −Example Bootstrap Example Categories Tech 95 Entertainment 30 Research 9 Viral 20 Sport 105 Do not click below: Danger
Read MoreBootstrap table-responsive class
Wrapping any .table in .table-responsive class, you will make the table scroll horizontally up to small devices (under 768px). When viewing on anything larger than 768px wide, you will not see any difference in these tables.To make a responsive table, you can try to run the following code −Example Bootstrap Table Subject Marks Student Programming 90 Amit Web Dev 92 Yuvraj Science 95 Sachin Economics 80 Tony
Read MoreWhat does Array.IsFixedSize property of array class do in C# ?
The IsFixedSize property of ArrayList class is used to get a value indicating whether the ArrayList has a fixed size.The following is an example stating the usage of isFixedSize property −Exampleusing System; using System.Collections; class Demo { public static void Main() { ArrayList arrList = new ArrayList(); Console.WriteLine("Adding some numbers:"); arrList.Add(45); arrList.Add(78); Console.WriteLine(arrList.Count); Console.WriteLine("myArrayList.IsFixedSize = " + arrList.IsFixedSize); } }OutputAdding some numbers: 2 myArrayList.IsFixedSize = FalseAbove we have added an array list −ArrayList arrList = new ArrayList();Then we have checked whether it has a fixed size or not −Console.WriteLine("myArrayList.IsFixedSize = " + arrList.IsFixedSize);
Read MoreC# int.Parse Vs int.TryParse Method
Convert a string representation of number to an integer, using the int.TryParse and intParse method in C#.If the string cannot be converted, then the int.TryParse method returns false i.e. a Boolean value, whereas int.Parse returns an exception.Let us see an example of int.Parse method −Exampleusing System.IO; using System; class Program { static void Main() { int res; string myStr = "120"; res = int.Parse(myStr); Console.WriteLine("String is a numeric representation: "+res); } }OutputString is a numeric representation: 120Let us see an example of int.TryParse method.Exampleusing System.IO; using ...
Read MoreDifferent ways of Reading a file in C#
Here, we are reading two different files −Reading text file −Exampleusing System; using System.IO; namespace FileApplication { class Program { static void Main(string[] args) { try { using (StreamReader sr = new StreamReader("d:/new.txt")) { string line; // Read and display lines from the file until // the end of the file is reached. while ((line = ...
Read MoreBootstrap .btn-xs class
To create extra small buttons, use the .btn-xs class.You can try to run the following code to implement btn-xs class in Bootstrap −Example Bootstrap Example The following are extra small buttons: Extra small Primary button Extra small button
Read More