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 Nitya Raut
158 articles
Implement your own itoa() in C
In this section we will see how to convert an integer number to a string.The logic is very simple. Here we will use the sprintf() function. This function is used to print some value or line into a string, but not in the console. This is the only difference between printf() and sprintf(). Here the first argument is the string buffer. where we want to save our data.Input: User will put some numeric value say 42Output: This program will return the string equivalent result of that number like “42”Algorithm:Step 1: Take a number as argument Step 2: Create an empty ...
Read MoreReplace substring with another substring C++
Here we will see how to replace substring with another substring. It replaces the portion of the string that begins at character pos and spans len characters.The structure of the replace function is like below:string& replace (size_t pos, size_t len, const string& str, size_t subpos, size_t sublen);The parameters are pos: It is an insertion point, str : It is a string object, len : It contains information about number of characters to erase.AlgorithmStep 1: Get the main string, and the string which will be replaced. And the match string Step 2: While the match string is present in the main string: Step 2.1: Replace it with the given ...
Read MoreCreate a StringBuffer object using a reference stored in a variable of type String in Java
To create a StringBuffer Object, we use the following syntax −StringBuffer s=new StringBuffer();When we create a reference to an object, we use the assignment operator. For example, String s1 = ”hi”; String s2 = s1; // s2 is a reference of s1A program to illustrate the creation of a StringBuffer object using a reference stored in a variable of type String is given below −Examplepublic class Example { public static void main(String args[]) { String input = "hey"; String s1 = input; // creating a reference of the String StringBuffer ...
Read MoreMedia object in Bootstrap
Use the .media-object class in Bootstrap to set the media object −Example Bootstrap Example Lolcode Tutorial Introduction LOLCODE is an esoteric programming language inspired by the funny things on the Internet. It is designed to test the boundaries of programming language design.
Read MoreBootstrap alert-danger class
The alert-danger class in Bootstrap is used to set danger action.You can try to run the following code to implement the alert-danger class in Bootstrap −Example Bootstrap Example This is danger action!
Read MoreCreate a blue button (primary) with Bootstrap
Use the .btn-primary class in Bootstrap to create a primary button in Bootstrap that is blue in color −Example Bootstrap Example Click below if you want to know the result: Result
Read MoreAdd a blue background color to simulate a pressed button in Bootstrap
To add a blue background color to simulate a pressed button, use the primary button in Bootstrap as in the following code −Example Bootstrap Example Score Result (2018) Result (2017)
Read MoreCreate a caret arrow icon that represents dropdown button with Bootstrap
Use the .caret class in Bootstrap to create a caret arrow icon representing dropdown button.You can try to run the following code to create a carot arrow icon −Example Bootstrap Example Brands The car brands: Car BMW Toyota Audi Mahindra Volvo
Read MoreUsage of CSS align-items property flex-start value
Use the align-items property with value flex-start to align flex items on the top.ExampleYou can try to run the following code to implement the flex-start value − .mycontainer { display: flex; height: 300px; background-color: red; align-items: flex-start; } .mycontainer > div { background-color: orange; text-align: center; line-height: 60px; font-size: 30px; width: 100px; margin: 5px; } Quiz Q1 Q2 Q3 Q4
Read MoreCreate a disabled look of a button with CSS
To create a disabled button look, use the CSS opacity property.ExampleYou can try to run the following code to create a disabled look of a button − .btn1 { color: black; text-align: center; font-size: 15px; } .btn2 { color: black; text-align: center; font-size: 15px; opacity: 0.5; } Result Click below for result: Enabled Disabled
Read More