We can use FIELD() function to find the index position of a particular string from a list of strings.SyntaxFIELD(str search,String1, String2,…StringN)Here, the str search is the string whose index number we want to search and String1, String …StringN is the list of strings from which the search would happen.Examplemysql> Select FIELD('good', 'Ram', 'is', 'a', 'good', 'boy')AS 'Index Number of good'; +----------------------+ | Index Number of good | +----------------------+ | 4 | +----------------------+ 1 row in set (0.00 sec)
Email addresses are pretty complex and do not have a standard being followed all over the world which makes it difficult to identify an email in a regex. The RFC 5322 specifies the format of an email address. We'll use this format to extract email addresses from the text.For example, for a given input string −Hi my name is John and email address is john.doe@somecompany.co.uk and my friend's email is jane_doe124@gmail.comWe should get the output −john.doe@somecompany.co.uk jane_doe124@gmail.comWe can use the following regex for exatraction −[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+We can extract the email addresses using the find all method from re module. For example, ... Read More
Responsive web design provides an optimal experience, easy reading and easy navigation with a minimum of resizing on different devices such as desktops, mobiles, and tabs).Let us see what is a responsive web design:
Let us understand the difference between CSS2 sizing property and CSS3 box-sizing property.CSS2 sizing propertyLive Demo .div1 { width: 200px; height: 100px; border: 1px solid green; } .div2 { width: 200px; height: 100px; padding: 50px; border: 1px solid pink; } TutorialsPoint.com TutorialsPoint.com CSS3 box-sizing propertyLive Demo .div1 { width: 300px; height: 100px; border: 1px solid blue; box-sizing: border-box; } .div2 { width: 300px; height: 100px; padding: 50px; border: 1px solid red; box-sizing: border-box; } TutorialsPoint.com TutorialsPoint.com
NULL as both argumentsMySQL returns blank output if we will use NULL as both of the arguments in CONCAT_WS() function.Examplemysql> Select CONCAT_WS('', NULL, NULL); +-------------------------+ | CONCAT_WS('', NULL, NULL) | +-------------------------+ | | +-------------------------+ 1 row in set (0.00 sec)NULL as one of the argumentMySQL returns the value of the other argument as output if we will use NULL as one of the argument in CONCAT_WS() function.Examplemysql> Select CONCAT_WS('', NULL, 'Delhi'); +----------------------------+ | CONCAT_WS('', NULL, 'Delhi') | +----------------------------+ | Delhi ... Read More
The HTML DOM TableData headers property returns and modify the value of headers attribute of a table in an HTML document.SyntaxFollowing is the syntax −1. Returning headersobject.headers2. Adding colspanobject.headers = “headers_ids”Let us see an example of headers property −Example Live Demo body { color: #000; background: lightblue; height: 100vh; text-align: center; } table { margin: 2rem auto; width: 400px; } .btn { background: #db133a; border: none; height: ... Read More
Both CONCAT() and CONCAT_WS() functions are used to concatenate two or more strings but the basic difference between them is that CONCAT_WS() function can do the concatenation along with a separator between strings, whereas in CONCAT() function there is no concept of the separator. Other significance difference between them is that CONCAT()function returns NULL if any of the argument is NULL, whereas CONCAT_WS() function returns NULL if the separator is NULL.ExampleThe example below demonstrate the difference between CONCAT() and CONCAT_WS() function −mysql> Select CONCAT('Ram', 'is', 'a', 'good', 'student') AS 'Example of CONCAT()'; +---------------------+ | Example of CONCAT() | +---------------------+ ... Read More
The HTML DOM TableData colSpan property returns and modify the value of colspan attribute of a table in an HTML document.SyntaxFollowing is the syntax −1. Returning colSpanobject.colSpan2. Adding colSpanobject.colSpan = “number”Let us see an example of colSpan property −Example Live Demo body { color: #000; background: lightblue; height: 100vh; text-align: center; } table { margin: 2rem auto; width: 400px; } .btn { background: #db133a; border: none; height: ... Read More
As we know TEXT data objects are useful for storing long-form text strings. The different TEXT objects offer a range of storage space from 255 bytes to 4 Gb. The following table shows the storage of different kinds of TEXT data type −Type of BLOBMaximum amount of Data that can be storedOverheadTINYTEXTUp to 255 bytes1 byteTEXTUp to 64 Kb2 bytes MEDIUMTEXTUp to 16 Mb3 bytesLONGTEXTUp to 4 Gb4 bytes
TEXT data objects are useful for storing long-form text strings in a MySQL database. Followings are some point about TEXT data type −TEXT is the family of column type intended as high-capacity character storage.The actual TEXT column type is of four types-TINYTEXT, TEXT, MEDIUMTEXT and LONGTEXT.The four TEXT types are very similar to each other; the only difference is the maximum amount of data each can store.The smallest TEXT type, TINYTEXT shares the same character length as VARCHAR.TEXT values are treated as character strings.TEXT has character set other than binary character set and collation.The comparisons and sorting are based on ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP