String functions



  boolean functions


                  in tableau 3 different types of boolean functions are available in strings .boolean functions means always they


                   gives output as either true are false.



                           the 3 boolean functions are


     
                                1.startswith


                                2.endswith


                                3.contains



                 syntax
           
                               startswith(input-string,search-string)



                               example---
                                   startswith('tableau','TAB')=true


                               endswith(input-string,search-string)


                         
                                example---
                                     endswith('tableau','TAB')=false


                                contains(input-string,search-string)

                                example---
                                    contains('tableau','tab')=true

CHAR FUNCTION 

     char function takes the input as number and it returns appropriate character.


               syntax

                    CHAR(number)


                    example
 
   
                    CHAR(84)=T


                    CHAR(116)=t

ASCII function 


          ASCII functon it returns the ascii number of input string

 
                   syntax ASCII(string)


                     example

                         ASCII('T')=84

                         ASCII('t')=116


note
 
     ASCII functions are different for the uppercase letters and lower case letter.

     For ascii if takes the input as string tableau will gives the ascii number of the starting character

     of the input string.

substring functions



   sub string is a part of the string to dispaly the part of the strings we are having 3 substrings.


         LEFT
         RIGHT
         MID


 LEFT

    left function will takes the input as string and the no of characters based on the no.of characters tableau

    will display the string from left part.


      syntax


              LEFT(string,no-of-characters)


             ex: left('tableau',3)=tab

Right


   right function will display thr no.of character from right


           syntax


              right(string,no-of-characters)

              right('tableau',3)=eau


mid


   MID functions will display the no.of characters basede on the start position.


     mid(input-string,start-position,[no-of-characters])

      mid('tableau',2,4)=able

find function


   find function will search the search string from the input string based on the start position .

  if the start position os ommitted tableau will search from the beginning.

 
       syntax


         find(string,search-string,[start-position])

         example


          find('google''oog')=2

LEN function


   len function finds the length of input stringd


        syntax

            LEN( STRING)

            len('google')=6

Replace function


            replace function will takes the input as string and in  the input string if you find the search string it will replace with the replacement string.



                        syntax


                                 Replace(string,search-string,replacement-string)


                       example
 
                             Replace('oracle','Ora','mira')=miracle

trimming function



  in tableau 3 types of trimming functions are available.

 
        LTRIM

        RTRIM

        TRIM

LTRIM function removes teh empty space from the left part of the input string.where as rtrim removes the empty space from the right part of the string.

 where as trim function eliminates empty spaces from both sides of the string.


            syn

             ltrim(string)


             exa


                ltrim(' tableau ') ='tableau '



 
            syn

             Rtrim(string)


             exa


                Rtrim(' tableau ') =' tableau'



         
            syn

             trim(string)


             exa


                trim(' tableau ') ='tableau'

space function 


   space function assign the space between two strings by taking a number.


            syntax


                       space(number)



            in tableau to combine two strings we are not having any available functions .the only work around is

           combined the string by using '+operator'.


      example


            'tableau'+space(2)v








 

1 comment: