Tag: first
Capitalize First letter of each word in a String in Java | Camel Case
In this article we will discuss how to capitalize first letter of each word in a String.Suppose given string is, this is the sample string Now after converting first letter of each word, string will become, This Is The Sample String This type of String is also called Camel Case. Advertisements Algorithm For Capitalizing First Letter …
Capitalize First letter of each word in a String in Java | Camel CaseRead More
Convert First Letter of each word of a String to Upper Case in C++
In this article we will discuss different ways to convert first letter of each word to upper case in a a given string i.e. Using STL algorithm Using Boost Filtered Iterator & Range Converting First Letter to Upper Case using STL Algorithm Used: Iterate over the characters in given string For each character check – …
Convert First Letter of each word of a String to Upper Case in C++Read More
Pandas : Select first or last N rows in a Dataframe using head() & tail()
In this article we will discuss how to select top or bottom N number of rows in a Dataframe using head() & tail() functions. Select first N Rows from a Dataframe using head() function pandas.DataFrame.head() In Python’s Pandas module, the Dataframe class provides a head() function to fetch top rows from a Dataframe i.e. Advertisements …
Pandas : Select first or last N rows in a Dataframe using head() & tail()Read More
Python: How to get first N characters in a string?
In this article, we will discuss how to fetch/access the first N characters of a string in python. This N can be 1 or 3 etc. Table Of Contents Get the first character of a string in python Get first N characters in a string Get first three characters of a string in python Get …
Check the first or last character of a string in python
In this article, we will discuss different ways to check the content of the first or last character of a string in python. Indexing in String Every character in a string has an index number associated with it. This index can be a positive or negative number. For example, we have a string, Advertisements sample_str …
Check the first or last character of a string in pythonRead More
Python: Capitalize the first letter of each word in a string?
In this article we will discuss 5 different ways to convert first letter of each word in a string to uppercase. We will also discuss what are the limitations of each approach and which one is best for us. Use title() to capitalize the first letter of each word in a string in python Python …
Python: Capitalize the first letter of each word in a string?Read More
Remove first N Characters from string in Python
In this article we will discuss ways to remove first N characters from a string either by using slicing or regex or simple for loop. Use slicing to remove first N character from string in python In python, we can use slicing to select a specific range of characters in a string i.e. Advertisements str[start:end] …
Python: Remove first element from a list (5 Ways)
This article will discuss different ways to delete the first element from a list in Python. Table of Contents Remove the first element from a list in Python using the pop() function Remove the first element from a list in Python using slicing Remove the first element from a list in Python using del keyword …
Python: Get first value in a dictionary
In this article we will discuss different ways to fetch the first value of a dictionary. Then we will look how to select first N values of a dictionary in python. Table of Contents: Get first value in a python dictionary using values() method. Get first value in a python dictionary using item(). Get first …
How to get first key in Dictionary – Python
In this article we will discuss different ways to fetch the first key of a dictionary. Then we will look how to select first N keys of a dictionary in python. Table of contents Get first key from a dictionary using keys() method. Get first key in a dictionary using iter() & next(). Get first …