string function which works like stringtocknizer(java)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • urvekshah
    New Member
    • Mar 2008
    • 2

    string function which works like stringtocknizer(java)

    hello frnds
    am new to mysql.i wan to separate my string.In java we have same function stringtocknizer ..is there any function available in mysql ?
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    Welcome to The Scripts!

    Since lots of members in this forum do not know Java, it is better to explain what you want to achieve with this function.

    Ronald
    Last edited by ronverdonk; Mar 17 '08, 07:23 PM. Reason: welcome

    Comment

    • urvekshah
      New Member
      • Mar 2008
      • 2

      #3
      Originally posted by ronverdonk
      Welcome to The Scripts!

      Since lots of members in this forum do not know Java, it is better to explain what you want to achieve with this function.

      Ronald
      stringtocknizer function parse string in to tokens by specified our deimiter..

      for ex: str1=a,b,c,d,e, f;
      stringtocknizer ( a , ' , ' );
      this function find all substring sepreted by ,
      so while(nextocken ())
      returns substrings separeted by ,

      Comment

      • ronverdonk
        Recognized Expert Specialist
        • Jul 2006
        • 4259

        #4
        There are a couple of these functions in PHP. Look at explode funtion which splits that string into an array.
        E.g.[php]$str = 'one|two|three' ;
        print_r(explode ('|', $str));
        [/php]results in an array $str
        Code:
        Array
        (
            [0] => one
            [1] => two
            [2] => three
        )
        See the php manual on other functions.

        Ronald

        Comment

        Working...