Split Function

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Split Function

Leandro Guimarães
Hello everyone,

  I'm trying to use the split function with beanshell.

  The problem is that I need to split using three characters.

  I'm trying  to use stringVar.split("[s]") but the result is very strange.

  What's the best solution to split a string with many characters?

Thanks in advanced.

Leandro Guimarães
------------------------------------------------------------------------------
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Split Function

Bugzilla from sfloess@nc.rr.com
LEandro,

Shouldn't that be the same as in straight Java?

What's the oddity?


Thanks,

Flossy

---- "Leandro Guimarães" <[hidden email]> wrote:
> Hello everyone,

  I'm trying to use the split function with beanshell.

  The problem is that I need to split using three characters.

  I'm trying  to use stringVar.split("[s]") but the result is very strange.

  What's the best solution to split a string with many characters?

Thanks in advanced.

Leandro Guimarães
------------------------------------------------------------------------------
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users



------------------------------------------------------------------------------
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Split Function

Leandro Guimarães
Hi Flossy,

  I think it's a regex problem... I need to split by |f|, i'm using the
regex \|f\| but it's ignoring the | | getting just the f.

  It's not a beanshell issue..

Thnsk


Leandro Guimarães


On Thu, Nov 6, 2014 at 12:46 PM, <[hidden email]> wrote:

> LEandro,
>
> Shouldn't that be the same as in straight Java?
>
> What's the oddity?
>
>
> Thanks,
>
> Flossy
>
> ---- "Leandro Guimarães" <[hidden email]> wrote:
> > Hello everyone,
>
>   I'm trying to use the split function with beanshell.
>
>   The problem is that I need to split using three characters.
>
>   I'm trying  to use stringVar.split("[s]") but the result is very strange.
>
>   What's the best solution to split a string with many characters?
>
> Thanks in advanced.
>
> Leandro Guimarães
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Beanshell-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/beanshell-users
>
>
>
------------------------------------------------------------------------------
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Split Function

Bugzilla from sfloess@nc.rr.com
Leandro,

Yep - gotcha.  So are you attempting to split on |f| or [f] - your first post seemed to indicate square brackets but this post looks to be or bars...

Do you have an example of what you are attempting to split?  For example - an example string with the embeded string to split on?

---- "Leandro Guimarães" <[hidden email]> wrote:

> Hi Flossy,
>
>   I think it's a regex problem... I need to split by |f|, i'm using the
> regex \|f\| but it's ignoring the | | getting just the f.
>
>   It's not a beanshell issue..
>
> Thnsk
>
>
> Leandro Guimarães
>
>
> On Thu, Nov 6, 2014 at 12:46 PM, <[hidden email]> wrote:
>
> > LEandro,
> >
> > Shouldn't that be the same as in straight Java?
> >
> > What's the oddity?
> >
> >
> > Thanks,
> >
> > Flossy
> >
> > ---- "Leandro Guimarães" <[hidden email]> wrote:
> > > Hello everyone,
> >
> >   I'm trying to use the split function with beanshell.
> >
> >   The problem is that I need to split using three characters.
> >
> >   I'm trying  to use stringVar.split("[s]") but the result is very strange.
> >
> >   What's the best solution to split a string with many characters?
> >
> > Thanks in advanced.
> >
> > Leandro Guimarães
> >
> > ------------------------------------------------------------------------------
> > _______________________________________________
> > Beanshell-users mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/beanshell-users
> >
> >
> >


------------------------------------------------------------------------------
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Split Function

Leandro Guimarães
In reply to this post by Leandro Guimarães
Hello,
  I was out of office yesterday..

  Yes, the problem was the regex, i need to split by |f|, i was using \|f\|
but right was \\|f\\|

Thank you very much!!

Leandro Guimarães


On Fri, Nov 7, 2014 at 6:51 PM, <[hidden email]> wrote:

> Did you ever get your problem solved?
>
> ---- "Leandro Guimarães" <[hidden email]> wrote:
> > Hello everyone,
>
>   I'm trying to use the split function with beanshell.
>
>   The problem is that I need to split using three characters.
>
>   I'm trying  to use stringVar.split("[s]") but the result is very strange.
>
>   What's the best solution to split a string with many characters?
>
> Thanks in advanced.
>
> Leandro Guimarães
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Beanshell-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/beanshell-users
>
>
>
------------------------------------------------------------------------------
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Split Function

Bugzilla from sfloess@nc.rr.com
Ah great!

Yeah regular expressions can be a frustrating beast :)  Glad you worked it out...

Flossy

---- "Leandro Guimarães" <[hidden email]> wrote:

> Hello,
>   I was out of office yesterday..
>
>   Yes, the problem was the regex, i need to split by |f|, i was using \|f\|
> but right was \\|f\\|
>
> Thank you very much!!
>
> Leandro Guimarães
>
>
> On Fri, Nov 7, 2014 at 6:51 PM, <[hidden email]> wrote:
>
> > Did you ever get your problem solved?
> >
> > ---- "Leandro Guimarães" <[hidden email]> wrote:
> > > Hello everyone,
> >
> >   I'm trying to use the split function with beanshell.
> >
> >   The problem is that I need to split using three characters.
> >
> >   I'm trying  to use stringVar.split("[s]") but the result is very strange.
> >
> >   What's the best solution to split a string with many characters?
> >
> > Thanks in advanced.
> >
> > Leandro Guimarães
> >
> > ------------------------------------------------------------------------------
> > _______________________________________________
> > Beanshell-users mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/beanshell-users
> >
> >
> >


------------------------------------------------------------------------------
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users
Loading...