Split string

Dear Sir

Is there a simple function like string.split

I want to just split this string 384; 603; 107; 38

Rgds

Nadir

and this thread can also help you:

http://supportforums.BlackBerry.com/T5/Java-development/how-to-split-a-string-in-to-a-string-array-w...

Tags: BlackBerry Developers

Similar Questions

  • Reg: Split string

    Dear all,

    Oracle Database 11g R2 11.2.0.1 SE1

    Consider the string

    Madhu, no. 34 Church street, main road, TMK

    I need to trim the string based on the conditions below.

    Condition 1: Split string 35 characters each

    Condition 2: Search until the previous by commas and visualize up to comma.

    Condition 3: split to then 35 characters.

    Power required for the highest chain

    Addr1 Addr2
    Madhu, no. 34 Church streetmain road, TMK

    Comment:

    Condition 1: Addr1-> 35 char = Madhu, no. 34 Church street, main ro

    Condition 2: Addr1-> comma previous search-> out-> Madhu, no. 34 Church street

    Condition 3: Addr2-> search for then 35 characters (i.e. "main road")-> 1-> Condition 2 Condition

    Please help in this regard.

    What's easier:

    with t
    as
    (
    select 'Madhu, No 34 Church street, main road, TMK' addr
      from dual
    )
    select substr(addr, 1, instr(addr, ',', -(length(addr) -35)) - 1) addr1,
          substr(addr, instr(addr, ',', -(length(addr) -35)) + 1, 35) addr2
    from t
    
  • How to split strings?

    Hello

    I'm using action made by Christophe (http://www.vcoteam.info/learn-vco/code-snippets-cancel-one-of-your-running-workflows.html) in order to cancel some workflows.

    Since the selection for tokens window does not display the parameters of the token, I created another entry for my workflow that is supposed to contain the name of the virtual machine, only for infomational purposes.

    I created an action to do this. When I use just "return myWorkflowToken.getInputParameters ();" then all settings are written to the input box.

    In my case, it looks like this:

    {ram = 3000.0, date = Mon Jan 24 16:25:16 THIS 2011, vm = < @id = FinderResult' VC:VirtualMachine/si0vm271/vm - 852' @name = "si0vm562" >, UC = 3.0}

    Since I need only the name of the virtual machine, in this case the part after @name (si0vm562), I need to retrieve it somehow off the chain.

    In the Orchestrator API, I found the String class with the method 'split '.

    At first, I tried to split the string into two parts using this code:

    var params_s = myWorkflowToken.getInputParameters ();
    var params_a_s = params_s.split ("name");
    return params_a_s [1];

    But when I run the workflow, the input dialogue tells me that the "split" function cannot be found.

    How can I retrieve the VM name on the report of a running workflow?

    Thank you

    Concerning

    Andreas

    Hi Andreas,

    I don't think that splitting strings works for your case.

    In fact workflowToken.getInputParameters () does not return a string. It is ch.dunes.scripting.jsmodel.JSProperties instead (you can check this of the Orchestrator client tools-> API Explorer). The split function is not found on the params_s variable.

    In order to achieve your goal, you can try the following:

    get the vm parameter

    Use the parameter name. This is the vm used according to the result of your message

    VM var = workflowToken.getInputParameters () .get ("vm");

    You can check for safety if the virtual machine is defined, except that the virtual machine is the required parameter

    If (vm! = null) {}

    return vm.name

    }

    The code snippet above you should return the value set for the parameter of the virtual machine.

    Hope this helps,

    Martin Marinov

  • Split string on the new line

    G ' Day,.

    I am writing a process that takes as input a multiline string. I need to chop this string through line breaks and iterate over each of them, but I can not work how to split a string based on the line breaks and TEO reference Guide is sufficiently vague as to what special characters (if any), you can split a string on.

    This process is intended to be launched directly via TEOWebConsole at this point else I would implement it in CCP instead.

    Thoughts?

    You can use the regular expression ^. * $

    and then feed in the chain and the loop and then through it, cut the ends and go from there.

    I have a TAP of some commonly used functions that I use in many of my automation. I call the function automation tools. I downloaded the zipped here tap. Download, unzip and import.

    It has a function called multiline convert to single-line string. While that might not be exactly what you're doing, you can remove the pieces of the rupture in the line break and be ok I think.

    Here is a screenshot of what I mean:

    -shaun

  • Split string values

    Hello

    I have a column in a table that contains a string separated by.

    for example

    IT. MATERIAL
    IT. APPS
    HE SOFTWARE

    I want to split the two out on two columns for example values

    Column1 - IT
    Column2 - Hardware
    etc.

    Can anyone help?

    Thank you

    Hello

    Here's one way:

    SELECT       SUBSTR ( str
                 , 1
               , INSTR (str, '.') - 1
               )         AS column1
    ,       SUBSTR ( str
                 , INSTR (str, '.') + 1
               )         AS column2
    FROM      table_x
    ;
    

    You might also achieve the same results using REGEXP_SUBTR, without nested funcitons, but it would be less effective.

    I hope that answers your question.
    If not, post a small example data (CREATE TABLE and only relevant columns, INSERT statements), and the results you want from this data. Examples of special cases, you have to manage, usch as strings with 2 or more '.'s, or without any strings "." s at all.
    Explain, using specific examples, how you get these results from these data.
    Always say what version of Oracle you are using (for example, 11.2.0.2.0).
    See the FAQ forum {message identifier: = 9360002}

  • Need help to split string

    Hi, I would like to know how one can divide the string, where start with capital letters.

    Example, if one have the name and first name: JamesLord, I'd like to split the name James of the Lord

    May be something like below for your entry,

    SELECT REGEXP_SUBSTR('JamesLord','[A-Z][a-z]+') FROM dual
    

    Thank you
    Sunil

  • Lively table consist of Split String?

    I have a question; is it possible to animate a table that contains a string of split? I added the channel in a dynamically done textfield, and I try to figure out how to have each letter will appear one by one, creating the effect of typing and acceleration towards the end... thanks a lot for all the help in advance.

    SerializableAttribute public class InfoPage extends AbstractPage {}

    private var _info:TextField;
    private var _infoText:String = "Lorem ipsum dolor sit amet, adipiscing elit computer. UT id orci at 195kgs porttitor ipsum. Donec pulvinar purus eget laoreet placerat, sem, dignissim ut auctor libero nisl is justo ac dui. Proin vel libero lectus, lacinia vel massa. Integer eget sapien ac massa lacinia non eros nec mattis. Vivamus ac lacus had convallis malesuada arcu. Amongst leo tincidunt id, posuere vel, bibendum metus malesuada metus. Praesent in sapien, nisi ut sollicitudin odio. Aenean sit amet lorem in eros laoreet congue. Nam tincidunt eros ac faucibus blandit arcu. Morbi pulvinar dui ante no congue in MPCs dapibus neque. Integer tellus and adipiscing placerat ligula eleifend. Nullam nibh nulla, sold had congue sed, pharetra magna EU. Nunc purus, dictum vitae, the ultrices blandit volutpat total had turpis. In euismod faucibus tristique. Amongst eget diam urna. DUIs sem and tincidunt facilisis quis, blandit tempus nunc ligula. Suspendisse sed lectus sit amet quam, eleifend commodo. « ;
    private var _infoArray:Array = _infoText.split("");

    public void InfoPage() {}

    createText();

    for (var i = 0; i < _infoArray.length; i ++) {}
    trace (_infoArray [i]);
    TweenLite.to (_infoArray [i], 1, {alpha: 1, ease:Cubic.easeOut});})
    }

    }

    private function createText (): void {}

    var _font: make = new Font();
    var _tf:TextFormat = new TextFormat();
    _tf.font = _font.fontName;
    _tf. Size = 14;
    _tf. Color = 0 x 333333;
    _tf. Leading = 3;

    _info = new TextField();
    _info. Name = "info";
    _info.defaultTextFormat = _tf;
    _info.antiAliasType = AntiAliasType.ADVANCED;
    _info.embedFonts = true;
    _info.WordWrap = true;
    _info. Multiline = true;
    _info. Selectable = false;
    _info. Text = _infoText;
    _info.x = 10;
    _info.y = 116;
    _info. Width = 800;
    _info. Height = 400;

    addChild (_info);



    }
    }
    }

    1 make sure that your textfield is added to the displaylist.

    2. make sure that your fla is published for actionscript 3.

    3 use:

    private void typeText(e:Event) {}
    index ++;
    If (index<_infoText.length)>
    _info. AppendText (_infoText.charAt (index));
    } else {}
    removeEventListener (Event.ENTER_FRAME, typeText);
    }
    }

  • Split string, delimiter based

    I searched these forumns and I can't find an Oracle function that splits a string into several columns according to a delimiter. I've seen some functions or procedures, but I ws wonder if there is a function of standard Oracle.

    data: 44444-123413

    I just want everything before the ' - '.

    44444


    Thank you!

    Hello

    Welcome to the forum!

    To get the front part of the (first) '-'

    REGEXP_SUBSTR ( txt
               , '^[^-]*'
               )
    

    What do you want if txt starts by '-'? The above expression return the NULL value.
    What do you want so txt does not contain '-'? The above expression returns all txt.

    [This thread | http://forums.oracle.com/forums/thread.jspa?threadID=945432&tstart=0] addresses the more general case of your question.

  • How to split string separated by commas and pass to the clause of the select statement

    Referring to article How to divide string separated by commas, then pass to clause of a select statement, tquery that there the following plan:

    Query1:

    select * from emp where ename in (
        select regexp_substr('SMITH,ALLEN,WARD,JONES','[^,]+', 1, level) from dual
        connect by regexp_substr('SMITH,ALLEN,WARD,JONES', '[^,]+', 1, level) is not null );
    

    Base1:

    Plan hash value: 4242290184
    
    
    --------------------------------------------------------------------------------------------
    | Id  | Operation                       | Name     | Rows  | Bytes | Cost (%CPU)| Time     |
    --------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT                |          |     1 |   133 |     7  (29)| 00:00:01 |
    |*  1 |  HASH JOIN                      |          |     1 |   133 |     7  (29)| 00:00:01 |
    |   2 |   VIEW                          | VW_NSO_1 |     1 |    46 |     3  (34)| 00:00:01 |
    |   3 |    HASH UNIQUE                  |          |     1 |       |     3  (34)| 00:00:01 |
    |*  4 |     CONNECT BY WITHOUT FILTERING|          |       |       |            |          |
    |   5 |      FAST DUAL                  |          |     1 |       |     2   (0)| 00:00:01 |
    |   6 |   TABLE ACCESS FULL             | EMP      |    14 |  1218 |     3   (0)| 00:00:01 |
    --------------------------------------------------------------------------------------------
    
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
    
       1 - access("ENAME"="$nso_col_1")
       4 - filter( REGEXP_SUBSTR ('SMITH,ALLEN,WARD,JONES','[^,]+',1,LEVEL) IS NOT NULL)
    

    However, the following query generates the plan I want:

    Query2:

    select * from emp where ename in ('SMITH','ALLEN','WARD','JONES');
    

    Plan2:

    Plan hash value: 3956160932
    
    
    --------------------------------------------------------------------------
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    --------------------------------------------------------------------------
    |   0 | SELECT STATEMENT  |      |     4 |   348 |     3   (0)| 00:00:01 |
    |*  1 |  TABLE ACCESS FULL| EMP  |     4 |   348 |     3   (0)| 00:00:01 |
    --------------------------------------------------------------------------
    
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
    
       1 - filter("ENAME"='ALLEN' OR "ENAME"='JONES' OR "ENAME"='SMITH' OR
                  "ENAME"='WARD')
    

    Can I change the query1 query for plan2?

    As Juliet was mentioned in the first SQL that you generate from the ENAME list that you must pass in the IN clause when executing. But in the second SQL, it passed as a static value. So first SQL must do more work. So you see a different execution plan.

    But this is a work around to get what you are looking for. But I can't say it's a foolproof method. But anyway here you go.

    SQL > var ename_list varchar2 (100)
    SQL > exec: ename_list: = 'SMITH, ALLEN, WARD, JONES ';

    PL/SQL procedure successfully completed.

    SQL > select *.
    2 of PEM
    where the 3 «,» | : ename_list | ',' like '%', | Ename | ',%';

    EMPNO, ENAME, JOB HIREDATE DEPTNO ID COM SAL MGR
    ---------- ------ --------- ---------- --------- ---------- ---------- ---------- ----------
    7369 SMITH COMMITTED 7902 2975 2 APRIL 81 0 20
    7499 ALLEN 7698 1600 20 FEBRUARY SALESMAN 81 300 30
    7521 WARD 7698 1250 22 FEBRUARY SALESMAN 81 500 30
    7566 JONES MANAGER 7839 2975 2 APRIL 81 0 20

    SQL > select * from table (dbms_xplan.display_cursor);

    PLAN_TABLE_OUTPUT
    -------------------------------------------------------------------------------------------------------
    SQL_ID, 848zhvbvgf7d6, number of children 0
    -------------------------------------
    Select * from emp where «,» | : ename_list | ',' like '%', | Ename
    || ',%'

    Hash value of plan: 2872589290

    --------------------------------------------------------------------------
    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |
    --------------------------------------------------------------------------
    |   0 | SELECT STATEMENT |      |       |       |     2 (100) |          |
    |*  1 |  TABLE ACCESS FULL | EMP |     1.    38.     2 (0) | 00:00:01 |
    --------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):
    ---------------------------------------------------

    1 - filter(','||:ENAME_LIST||',' LIKE '%,'||") ENAME "|", %')

    19 selected lines.

    SQL >

  • The document title Split String Script into an If identified

    Hello

    I have a console script that will extract the file title extension in the document properties:

    firstWord = this.info.Title.split("."); FirstWord = Event.Value [1];

    The example document title is: DWGTest.idw

    After the script is run from the console of the file extension is displayed correctly as: idw

    I now need to integrate the script with an if statement, and then perform an action.

    However, after you run the script I get a syntax error.

    Please can someone tell how can I modify the script works correctly?

    If the title in the properties of the document contains the file extension idw can create a signature field

    firstWord = this.info.Title.split("."); FirstWord = Event.Value [1];

    If (firstWord is "SDI")

    {

    var this.numPages = NUMPAGES;

    for (var i = 0; i < numpages; i ++)

    var a = this.addField ("Chk R1", "signature", 0,

    ([1093, 119.5, 1054.5, 136,5]) ;

    }

    Any help will be most appreciated.

    Thank you.

    Try to simplify it a little bit. This code tries to add a field of signature several times in the same place on the first page, assuming that there are several pages, and the rect does not seem right.

    var firstWord = info.Title.split(".")[1];
    
    if (firstWord === "idw") {
        addField("Chk R1", "signature", 0, [54.4, 136.5, 93, 119.5]);
    }
    

    Note that I changed the boundaries of the field (left and right) to try to ensure that the scope should be placed on the page. What is the width and height of your pages? The rect values can be read as "left side, top, right, bottom", with the origin (point 0,0) being the lower-left corner of the page. The values are in points and there are 72 points per inch.

  • Split string with regular model and expression(10g)

    Hello world

    Could I ask you, your opinion on this query (tuning)?


    SQL * more: version 10.1.0.4.2 - Production on Tue October 21 10:40:07 2008

    Copyright (c) 1982, 2005, Oracle. All rights reserved.


    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64 bit Production
    With partitioning, OLAP and Data Mining options


    SQL > select * from test_1;

    NR X
    ---------- -----------------------------------------------------------------------------------------
    1 F01
    2 F02
    3 D01:D02
    4 F03:G45:D34
    5 G56:Y45:U89:E56


    SQL > SELECT NR, STRING
    2 FROM TEST_1
    MODEL 3
    4 RETURN THE UPDATED LINES
    5 PARTITION BY (NR)
    6 DIMENSION (POSITION 0)
    MEASURES 7 (CAST (' ' AS VARCHAR2 (50)) AS STRING, X, LENGTH (REGEXP_REPLACE (X,'[^:] + ",")) + 1 NB_MOT)
    8 RULES
    9 (STRING [FOR POSITION 1 TO INCREMENT 1 NVL(NB_MOT[0],1)] =
    10 CASES WHERE NB_MOT [0] IS NULL THEN X [0] ELSE REGEXP_SUBSTR (X [0], "[^:] +', 1, CV (POSITION)") END)
    11 ORDER BY 1;

    STRING OF NR
    ---------- --------------------------------------------------
    1 F01
    2 F02
    3 D01
    3 D02
    4 G45
    4 F03
    4 D34
    5 G56
    5 Y45
    U89 5
    5 E56

    11 row (s) selected (s).


    Execution plan
    ----------------------------------------------------------
    0 SELECT STATEMENT Optimizer = ALL_ROWS (cost = 5 card = 5 bytes = 325
    )

    1 0 SORTING (ORDER BY) (cost = 5 card = 5 bytes = 325)
    2 1 MODEL (ORDERED) SQL (cost = 5 card = 5 bytes = 325)
    3 2 TABLE ACCESS (FULL) 'TEST_1' (TABLE) (cost = 4 = 5 bytes map = 325)



    Kind regards
    Salim.

    Why?

    How long takes now?

    Can you explain?

    Kind regards.

    LOULOU.

  • Split string to a char

    Hello

    I have following the query,
    SELECT 'ABCD' STR FROM DUAL;
    Result
    ABCD
    But I want to output as below
    A
    B
    C
    D
    SQL> SELECT 'ABCD' col1,SUBSTR('ABCD',level,1) col2
      2  FROM dual
      3  CONNECT BY level<=length('ABCD');
    
    COL1 COL2
    ---- ----
    ABCD A
    ABCD B
    ABCD C
    ABCD D
    
    SQL> 
    
  • Split the string of specific character in cfscript

    Hi I want to split string (7 <>2, 3 6 0.6 <><>) by the individual (<>) of characters and store it in the table.. .as c# code:

    dataList whwre =<>7 2, 3 6 0.6 <><>

    String [] wordsStrings = Regex.Split (dataList, "<>");

    You want to use the function ListToArray in ColdFusion.  Treat the <> as a list separator.  The important part here is setting the last argument true, for the argument of multiCharacterDelimiter .

    dataList = ' 7<>2, 3<>6<>0.6;

    wordsStrings = listToArray (dataList, "<>", false, true);

  • Split a string when a url is found

    Hello

    I am trying to find a URL within a string and it (the text before the link itself and the following text) divided into distinct parts. I tried the split (...) method, but never adds the URL as one of the parts of the split. Is it possible to do? That's what I'm currently using:
    public static List<String> findUrls(String input) {
         List<String> result = new ArrayList<String>();
         Pattern pattern = Pattern.compile("\\(?\\b(http://|www[.])[-A-Za-z0-9+&@#/%?=~_()|!:,.;]*[-A-Za-z0-9+&@#/%=~_()|]");
         Matcher matcher = pattern.matcher(input);
         while (matcher.find()) {
              result.add(matcher.group());
         }
         return result;
    }
    I can't understand how to split like that, but I tried this, which works, just not as I want (showing the first part, end of game and the link):
    public void findUrl(String input) {
            String[] test = input.split("\\(?\\b(http://|www[.])[-A-Za-z0-9+&@#/%?=~_()|!:,.;]*[-A-Za-z0-9+&@#/%=~_()|]");
            for (int i = 0; i < test.length; i++) {
                 System.out.println(test);
    }
    }
    The output I get when doing the findUrl(...) method is:
    System.out.println (Regex.findUrl ("just testing http://www.google.com/ this split of the string"));
    is
    just test
    This string of split
    Any suggestions or help?
    
    Thanks,
    
    aeternaly                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

    It's ugly, and I know there's a way easier and cleaner to do and I don't know if that's what you want, but you may be able to use it as a starting point:

    "xxx abc xxx def xxx xxx ghi jkl   xxx".split("((?<=xxx)\\s++)|(\\s++(?=xxx))")
    
    // gives
    
    ["xxx", "abc", "xxx", "def", "xxx", "xxx", "ghi jkl", "xxx"]
    

    where xxx is your URL scheme. You can keep the spaces around your matches to that model you rid of occurrences of {noformat} \\s++ {noformat}, but this also includes the empty string at the beginning of the sequence and the spaces between the consecutive games:

    ["", "xxx", " abc ", "xxx", " def ", "xxx", " ", "xxx", " ghi jkl   ", "xxx"]
    

    Also, I think that your URL scheme is too complex. Why not use something much more simple that will work in the majority of cases?

    pat = "(http://|www\\.)\\S++"
    input = "http://www.google.com/a/b?c=d&e=f abc www.bibblebobble.net def  ghi   www.bibblebobble.net    http://honkhonk";
    input.split(String.format("((?<=%s)\\s++)|(\\s++(?=%s))", pat, pat))
    
    Result: ["http://www.google.com/a/b?c=d&e=f", "abc", "www.bibblebobble.net", "def  ghi", "www.bibblebobble.net", "http://honkhonk"]
    

    Although I suspect that's what you were trying to do, but maybe you didn't know that you could use

    \S
    

    means "anything but a space" and

    +
    

    to mean "one or more".

    http://download.Oracle.com/javase/tutorial/essential/regex/
    http://www.regular-expressions.info/tutorial.html

    EDIT: I probably account for the https protocol and ignore case. Must be something like that, but I have not tested:

    pat = "(?i)(http(s?)://|www\\.)\\S++"
    

    Edited by: jverd August 6, 2011 14:09

  • split a string into pl/sql

    Hello

    How to split a string and store in an associative array in pl/sql.function

    My string like this

    '1102,1101,1012,1011,1010,1009,1008,1007,1006,10005,1004,1003,1002,1001'
    and assign it to the array list. According to
    can someone please help

    concerning
    r

    You can try the following. Although I recommend, it would be better to write the function code php as a java stored procedure parser and use the result. We have a class defined in Java String Tokenizer.

    -- Define function to split string into tokens
    FUNCTION get_token(
        p_input_string IN VARCHAR2,            -- input string
        p_token_number IN PLS_INTEGER,         -- token number
        p_delimiter    IN VARCHAR2 DEFAULT ',' -- separator character
      )
      RETURN VARCHAR2
    IS
      v_temp_string VARCHAR2(32767) := p_delimiter || p_input_string ;
      v_pos1 PLS_INTEGER ;
      v_pos2 PLS_INTEGER ;
    BEGIN
      v_pos1     := INSTR( v_temp_string, p_delimiter, 1, p_token_number ) ;
      IF v_pos1   > 0 THEN
        v_pos2   := INSTR( v_temp_string, p_delimiter, 1, p_token_number + 1) ;
        IF v_pos2 = 0 THEN
          v_pos2 := LENGTH( v_temp_string ) + 1 ;
        END IF ;
        RETURN( SUBSTR( v_temp_string, v_pos1+1, v_pos2 - v_pos1-1 ) ) ;
      ELSE
        RETURN NULL ;
      END IF ;
    EXCEPTION
      WHEN OTHERS THEN
        RAISE;
    END get_token;
    
    -- Call the above function in loop for a string with N tokens
    DECLARE
          TYPE assoc_arr_str_typ IS TABLE OF VARCHAR2(100) INDEX BY PLS_INTEGER;
          str_arr assoc_arr_str_typ;
    
          v_str VARCHAR2(200) := '1102,1101,1012,1011,1010,1009,1008,1007,1006,10005,1004,1003,1002,1001' ;
          v_token   VARCHAR2(4) ;
          i          PLS_INTEGER := 1 ;
        BEGIN
          LOOP
            v_token := get_token( v_str, i , ',') ;
            EXIT WHEN v_token IS NULL ;
            dbms_output.put_line( v_token ) ;
            str_arr(i) := v_token;
            i := i + 1 ;
         END LOOP ;
      END ;
     /
    

    Published by: GG 24 March 2011 09:51

Maybe you are looking for