Skip to content

Tag Archives: Perl-String-Functions

A string in Perl is a scalar variable and start with a ($) sign and it can contain alphabets, numbers, special characters. The string can… Read More
The chomp() function in Perl is used to remove the last trailing newline from the input string. Syntax: chomp(String) Parameters: String : Input String whose… Read More
The chr() function in Perl returns a string representing a character whose Unicode code point is an integer. Syntax: chr(Num) Parameters: Num : It is… Read More
The chop() function in Perl is used to remove the last character from the input string. Syntax: chop(String) Parameters: String : It is the input… Read More
uc() function in Perl returns the string passed to it after converting it into uppercase. It is similar to ucfirst() function which returns only first… Read More
sprintf() function in Perl uses Format provided by the user to return the formatted string with the use of the values in the list. This… Read More
rindex() function in Perl operates similar to index() function, except it returns the position of the last occurrence of the substring (or pattern) in the… Read More
The ord() function is an inbuilt function in Perl that returns the ASCII value of the first character of a string. This function takes a… Read More
quotemeta() function in Perl escapes all meta-characters in the value passed to it as parameter. Example: Input : "GF*..G" Output : "GF\*\.\.G" Syntax: quotemeta(value) Parameter:… Read More
substr() in Perl returns a substring out of the string passed to the function starting from a given index up to the length specified. This… Read More
length() function in Perl finds length (number of characters) of a given string, or $_ if not specified. Syntax:length(VAR) Parameter: VAR: String or a group… Read More
lc() function in Perl returns a lowercased version of VAR, or $_ if VAR is omitted.  Syntax: lc(VAR)Parameter: VAR: Sentence which is to be converted to… Read More
lcfirst() function in Perl returns the string VAR or $_ after converting the First character to lowercase. Syntax: lcfirst(VAR) Parameter: VAR: Sentence whose first character… Read More
This function returns the position of the first occurrence of given substring (or pattern) in a string (or text). We can specify start position. By… Read More
split() is a string function in Perl which is used to split or you can say to cut a string into smaller sections or pieces.… Read More