![]() $ perl_tr_string_variable2 =~ tr/a-z/a-z/s Print " string without s operator : $ perl_tr_string_variable1 \n" $ perl_tr_string_variable1 =~ tr/a-z/a-z/ $ perl_tr_string_variable2 = "ii aam lleeaarrniinngg nneeww llaannggaauuggee" $ perl_tr_string_variable1 = "ii aam lleeaarrniinngg nneeww llaannggaauuggee." The basic tr function with “s” operator example and output. Print " numbers to characters : $ perl_tr_string_variable2 \n" Print "original string2 : $ perl_tr_string_variable2 \n" Print " characters to numbers : $ perl_tr_string_variable1 \n" Print "original string1 : $ perl_tr_string_variable1 \n" The basic tr function with character to number conversion example and output.Ĭode: $ perl_tr_string_variable1 = "i am learning technical language with online hub." Print " uppercase to lowercase : $ perl_tr_string_variable2 \n" $ perl_tr_string_variable2 =~ tr/A-z/a-z/ Print "original string : $ perl_tr_string_variable2 \n" Print " lowercase to uppercase : $ perl_tr_string_variable1 \n" Print "original string : $ perl_tr_string_variable1 \n" $ perl_tr_string_variable2 = "I A LEARNING PERL TR FUNCTION." The basic tr function with Sentence case conversion example and output.Ĭode: $ perl_tr_string_variable1 = "i am learning Perl language." Print "$ perl_tr_string_variable2 \n" Examplesĭifferent examples are mentioned below: Example #1 The working sample of the tr function is below.The string can return the replaced list using the Perl string variable.$ perl_tr_string_variable2 =~ tr/a-z/*/c Here we are using the c operator to understand the working of the operator function.The user can use any operators like s, c, d for more convenience and usability. ![]() $ perl_tr_string_variable1 =~ tr/a-z/A-z/ The basic tr function syntax for translate the string in the Perl language.$ perl_tr_string_variable2 = "i am learning Perl tr function." $ perl_tr_string_variable1 = "I am learning Perl language." Create the string variable and initialize it with some characters or lists.or are commonly using Perl software websites. The download the Perl software and install it in your operating system of the device. ![]()
0 Comments
Leave a Reply. |