Forum Discussion

Rupa_34586's avatar
Rupa_34586
Icon for Nimbostratus rankNimbostratus
Mar 09, 2010

retrive rupa from "rupa"

Hi,

 

 

i want to function to retrive string from quatations

 

 

I have string "rupa". I want to retrive just rupe from that.

 

 

I tried using split function but it did not work can you give me some code so that i have to retrive rupa from "rupa"

 

 

Regards,

 

Rupa

3 Replies

  • Hi Rupa,

     

     

    There are a few ways to do this using TCL or iRules-specific commands:

     

     

     

    set test_string {"test"}

     

    "test"

     

     

    scan $test_string {"%[^"]"}

     

    test

     

     

    [getfield {"test"} "\"" 2]

     

    test

     

     

    Or is the input string more than one double quoted token?

     

     

    Aaron
  • Thanks Aaron. It worked.

     

     

    "/ is the limiter then . thanks for the help
  • " is the delimiter for getfield, but you have to escape the double quote with a backslash.

     

     

    Aaron