I want to divide the strings!

Hello world... I m to get a url and store it in a vector... I need to remove the last 4 characters of the url... That is to say say

www.MyVideo.Fly

It's the url retrieved and stored in means of vector... I want to like...

www.MyVideo.3gp

Please give me an idea... its very URGENT!

String oldURL = "www.myvideo.fly";
String newURL = oldURL.substring(0, oldURL.length() - 3) + "3gp";

I think everyone confuses what you mean by 'split' to this that java, means 'split() '. simply do something like the above.

Tags: BlackBerry Developers

Similar Questions

  • I want to divide the partion primary/basic C in 2 small, a C (primary with the OS) and G (extended-for everything else).

    Hi all.

    I just installed windows XP Pro on one of my computers. Now when installing, it showed me the main partition C and another extended partition (which was very small). Now windows gave me the option to install Windows on the C partition and it me has failed to use the extended partition, he said is reserved for windows. Now my problem is that it does give me an option to create a new partition (except on the extended unallowed was D). I want to divide the partion primary/basic C in 2 small, a C (primary with the OS) and G (extended-for everything else). I want only the OS on C. How do I do that? The PC has a single 79GB hard drive

    Hi DextrousDave,

    Refer to the article below to learn more about partitioning during the installation of Windows XP.

    How to partition and format a drive hard using the Windows XP Setup program

    http://support.Microsoft.com/kb/313348

  • I want to find the string "EMP1" procedures have this chain of the package

    Hi team,

    I have a package, the package, it has 70 technical acts, I want to find the string "EMP1" what procedures to have this channel under this package.
    If I use dba_source its name from package edition only. not to say about wise procedures in this package.
    can you please help here to find procedure under the package names because I analysis for all of the schema.

    Thanks in advance.

    Thanks and greetings
    Vincent

    Hello

    You can use the pl/sql program to do this by giving the name of the package as an input. It won't like your exact expectations. But of course, it will help you.



    DECLARE

    CURSOR c1 IS

    SELECT *.

    From all_source b

    WHERE upper (b.text) like '% EMP1% '.

    AND b.name = & nom_package

    ONLINE ORDERING;

    CURSOR c2 (ln_line NUMBER) IS

    SELECT *.

    From all_source one

    WHERE b.SID = & nom_package

    AND (UPPER (a.TEXT) LIKE '% FUNCTION %') OR UPPER (a.TEXT) LIKE '% PROCEDURE % '.

    AND a.line<=>

    ORDER BY desc line;

    lv_source all_source % rowtype;

    BEGIN

    I'm in c1 LOOP

    --

    OPEN c2 (i.line);

    Get INTO lv_source c2;

    dbms_output.put_line (' procedure ' | lv_source.) Line: ' text: ' | lv_source. (Text);

    CLOSE C2;

    --

    END LOOP;

    END;

    /




    Concerning

    Patrick Reddy.K

  • How to divide the string in bb-cascades

    1. I have a table of data as json

      {"RegistrationResult":"Registered Success:Empid:157:TableName:COMPANY156"}
      
    2. Now, how I want to split the show list view in qml and string as the follwing

      Success stories

      EmpID = 157

      TableName = COMPANY156

    3. Please tell the concept of cutting a string and show the result in qml

    I can get the result of the follwing method:

    {"RegistrationResult":["Registered Success","Empid":"157","TableName":"COMPANY156"]}
     
    

    But I do not know how to split the string for a first... Help, please...

    svmrajesh wrote:

    1. ,......"Registered Success:Empid:157:TableName:COMPANY156"}

    Take a look at QString docu

    Just do something like

    myString.split(':')

    and you get a QStringList and this QStringList is directly mapped to a table in QML JavaScript

  • divide the string and replace the token

    Hi all

    I have a field called "FreeText" that contains data that is more or less according to the following format.

    "1 NEWTON/ISAACSIR WITHOUT DAIRY AND PEANUT PREFER ONE REGIME FRUITS"

    It contains the name of a text followed by someone. I want to this tokenized by using space as the delimiter and the first token can separate from the rest of it. The expected output would be two columns containing.

    "1 NEWTON/ISAACSIR" and the second column
    "NO DAIRY AND NO PEANUT PREFER ONE REGIME FRUITS."

    Thanks and greetings

    Crusoe

    Replace with your channel:
    It splits the string for 2 values separated by the character of the first found SPACE.

    WITH abc AS
      (SELECT '1NEWTON/ISAACSIR NO DAIRY PRODUCTS AND NO PEANUTS PREFERS A FRUIT ONLY DIET' A
       FROM dual)
    SELECT SUBSTR(A,1,INSTR(a,' ',1)-1) , SUBSTR(A,INSTR(a,' ',1)+1 , LENGTH(a))
    FROM abc
    

    Published by: AJ99 on July 1, 2009 11:09

  • Divide the string into rows according to the space

    I'm using Oracle 11.2.0.3.  I need a faster way to divide the organization names based on space as possible just using SQL.

    with org as

    (

    Select 1 org_pk, org_nm 'ALL american, INC.' of any double union

    Select org_pk 2, org_nm "COMPANY A.G" Union double all the

    Select org_pk 3, org_nm "GROWTH FUND SPONSORS and SONS, Inc." of the double

    )

    Select * org;

    Result, I need is

    1. ALL THE

    1 american

    1, INC.

    2 A.G

    2 COMPANY

    3. THE GROWTH

    3 FUND

    3 SPONSORS

    3 and

    3 WIRES,

    3 INC.

    Thank you very much.

    You can use GROUP BY with LISTAGG or XMLAGG. And ordinalite allows to preserve order:

    with org as)

    Select 1 org_pk, org_nm 'ALL american, INC.' of any double union

    Select 2 org_pk, 'A.G COMPANY' org_nm of all the double union

    Select org_pk 3, org_nm "GROWTH FUND SPONSORS and SONS, Inc." of the double

    )

    Select org_pk,

    x.org_nm,

    x.o

    org,.

    XMLTable)

    "ora: tokenize(.,"").

    by the way ' ' | org_nm

    columns

    path of varchar2 (4000) to org_nm '.'.

    o for the ordinalite

    ) x

    where x.org_nm is not null

    /

    ORG_PK ORG_NM O
    ---------- ------------------------------ ----------
    1 ALL                                     2
    1 American 3
    1 ,INC                                    5
    2 A.G                                     2
    2 COMPANY 4
    3 GROWTH                                  2
    3 FUND                                    3
    3 4 SPONSORS
    3 and                                     5
    3 SONS,                                   6
    3 INC.                                    7

    11 selected lines.

    SQL >

    However, I would like to use SUBSTR/INSTR plain + CONNECT BY if the volumes are large or performance is important.

    SY.

  • divide the string separated by commas into columns

    Hello
    I have the following string
    str := 'abcd,123,defoifcd,87765'
    The above string must be divided into 4 different columns

    How can I achieve that

    Thank you

    Hello

    Use REGEXP_SUBSTR:

    SELECT  REGEXP_SUBSTR (str, '[^,]+', 1, 1)    AS part_1
    ,       REGEXP_SUBSTR (str, '[^,]+', 1, 2)    AS part_2
    ,       REGEXP_SUBSTR (str, '[^,]+', 1, 3)    AS part_3
    ,       REGEXP_SUBSTR (str, '[^,]+', 1, 4)    AS part_4
    FROM    table_x
    ;
    

    Str can contain foul? For example, you can have a string like ' foo, bar ", where you want to count part_2 and part_3 as NULL and 'bar' is part_4? If so:

    SELECT  RTRIM (REGEXP_SUBSTR (str, '[^,]*,', 1, 1), ',')    AS part_1
    ,       RTRIM (REGEXP_SUBSTR (str, '[^,]*,', 1, 2), ',')    AS part_2
    ,       RTRIM (REGEXP_SUBSTR (str, '[^,]*,', 1, 3), ',')    AS part_3
    ,       LTRIM (REGEXP_SUBSTR (str, ',[^,]*', 1, 3), ',')    AS part_4
    FROM    table_x
    ;
    

    Published by: Frank Kulash, February 14, 2012 08:46

  • Divide the string without any delimeters

    A little banal theme, but...

    I have a string saying 1010002. I need to separate groups of two digits itno - 1 01 00 02, if it is uneven - the most significant byte is the only one.

    Thanks in advance.

    If you check his comment he doesn't want it reversed, does?

  • Simple question: how to divide the string into multiple lines concatenated?

    Hi people,

    Maybe it's an easy question.

    How to split a string that is concatenated into multiple lines by using the SQL query?

    ENTRY:
    select 'AAA,BBB,CC,DDDD' as data from dual
    Delimiter = ', '.

    Expected results:
    data
    ------------
    AAA
    BBB
    CCC
    DDDD
    I'm looking for something nice to feature "an opposite to «sys_connect_by_path»»

    Thank you
    Tomas
    with t as (select 'aaaa,,bbbb,cccc,dddd,eeee,ffff' as txt from dual)
    -- end of sample data
    select REGEXP_SUBSTR (txt, '[^,]+', 1, level)
    from t
    connect by level <= length(regexp_replace(txt,'[^,]*'))+1
    
    REGEXP_SUBSTR(TXT,'[^,]+',1,LE
    ------------------------------
    aaaa
    bbbb
    cccc
    dddd
    eeee
    ffff
    
  • divide a string in order to get the level of separate list.

    Hello

    I want to divide a string in order to get the level of separate list to connect this with a category table.
    The size of my list is dynamic and for this reason, I am unable to find a way to do it!

    This is an example of what I need to do:
    Consider the following list:
    Category                Category_ID
    Age                     1
    Less than 3 months      1.1
    Less than 9 months      1.2
    Less than 1 year        1.3
    Risk                    2
    Danger                  2.1
    High                    2.1.1
    medium                  2.1.2
    low                     2.1.3
    If I have a row that has category_id "2.1.3" I want to present values as:
    "Risk.Danger.Low"
    If I have a row that has category_id "1.1" I want to present values as:
    "Age.Less than 3 months"
    No clue as to what I should look for to achieve this?
    This will serve to produce a report. This report contains a few lines of a thousand and the categories will be around 100.


    Thank you
    Ricardo

    Hello

    I think this is a job for sys_connect_by_path...

    with p as
    (   select 'Age'             descr  ,'1' cat from dual union all
       select 'Less than 3 months'      ,'1.1' cat from dual UNION ALL
       select 'Less than 9 months'      ,'1.2' cat from dual union all
       select 'Less than 1 year'        ,'1.3' cat from dual union all
       select 'Risk'                    ,'2' cat from dual union all
       select 'Danger'                  ,'2.1' cat from dual union all
       select 'High'                    ,'2.1.1' cat from dual union all
       select 'medium'                  ,'2.1.2' cat from dual union all
       select 'low'                     ,'2.1.3' cat from dual
    )
    SELECT
        cat,
        LTRIM(SYS_CONNECT_BY_PATH(descr,'.'),'.') route
    FROM
        (
            SELECT
                descr,
                cat,
                SUBSTR(cat,1,INSTR(cat,'.',-1)-1) parent
            FROM
                p
        )
    START WITH
        parent IS NULL
    CONNECT BY
        PRIOR cat = parent
    /
    SQL> with p as
      2  (   select 'Age'             descr  ,'1' cat from dual union all
      3     select 'Less than 3 months'      ,'1.1' cat from dual UNION ALL
      4     select 'Less than 9 months'      ,'1.2' cat from dual union all
      5     select 'Less than 1 year'        ,'1.3' cat from dual union all
      6     select 'Risk'                    ,'2' cat from dual union all
      7     select 'Danger'                  ,'2.1' cat from dual union all
      8     select 'High'                    ,'2.1.1' cat from dual union all
      9     select 'medium'                  ,'2.1.2' cat from dual union all
     10     select 'low'                     ,'2.1.3' cat from dual
     11  )
     12  SELECT
     13      cat,
     14      LTRIM(SYS_CONNECT_BY_PATH(descr,'.'),'.') route
     15  FROM
     16      (
     17          SELECT
     18              descr,
     19              cat,
     20              SUBSTR(cat,1,INSTR(cat,'.',-1)-1) parent
     21          FROM
     22              p
     23      )
     24  START WITH
     25      parent IS NULL
     26  CONNECT BY
     27      PRIOR cat = parent
     28  /
    
    CAT   ROUTE
    ----- ------------------------------
    1     Age
    1.1   Age.Less than 3 months
    1.2   Age.Less than 9 months
    1.3   Age.Less than 1 year
    2     Risk
    2.1   Risk.Danger
    2.1.1 Risk.Danger.High
    2.1.2 Risk.Danger.medium
    2.1.3 Risk.Danger.low
    

    HTH

    David

    Published by: Bravid on Sep 2, 2011 14:50

  • How to split the string?

    Hello

    I get data like ~^1820|-93.13|+4.57|-3.20 | 183,62'

    any value assigned something like height, angle, etc...

    I want to divide this string could someone please help me how to do this.

    I would like in a similar.  1820

    a = 93.13

    b = + 4.57

    c =-3.20

    d = 183.62

    Thank you much in advance.

    With the best wishes,

    Ankit.

    Hi Pierre,.

    use SpreadsheetStringToArray:

  • Structure from case string "&lt;------"-LabVIEW converts the string

    Hello

    I want to parse the string lines read from a data file.  Some chains start with the characters ".<\".  when="" i="" enter="" this="" kind="" of="" string="" as="" a="" case="" in="" a="" case="" structure="" the="" string="" is="" being="">

    For example, I'm going home. "<\C" (upper-case="" c)="" as="" my="" case="" string,="" it="" changes="" to=""><\f".  if="" i="" enter=""><\c" (lower-case="" c)="" as="" the="" string="" it="" becomes="">

    I am currently using LabVIEW 2012.

    Any ideas what's happening?

    Thank you

    Ian

    Some ASCII characters are nonprinting control characters (less than 32 values). These are sometimes encoded using the backslash code and it seems that is what makes the structure of matter - when you type \C, the structure of the performer as "oh, you want the value 0x0C ASCII, which in the code for backslash is represented" as \f (means 'form feed). "When this is the case, you typically use one-to represent the------characters, so you really need set the structure to match on.<>

  • How to replace the string "\" on json webservice?

    Hello

    I have problem with this json

    "{\"search_result\":[{\"name\":\"Mall Summarecon\",\"category\":\"BusinessEntity\",\"id\":\"1\"},{\"name\":\"Bamboo Dim Sum\",\"category\":\"BusinessEntity\",\"id\":\"2\"},{\"name\":\"Dimsum Ceker\",\"category\":\"Item\",\"id\":\"1\"}]}"
    

    I want to replace the string "\".

    the json are already working on my app via .cpp file

    I already add json.replace on my qml

    function simpleSearch(response){
            indicator.stop()
            model.clear()
            console.log("Response: "+response)
            var json = JSON.parse(response)
            json = json.replace('\\', ' ') // this is how the way i replace
            if (json == "[]")
                notFound.visible = true
    
            else
                model.append(json.search_result)
        }
    

    but still does not work

    is there a different way to replace it?

    Thank you

    Change your simpleSearchFinished as follows

    ....simpleSearchFinished()
    {
        QNetworkReply *reply = qobject_cast(sender());
        if (!reply->error()){
            QByteArray response = reply->readAll();
            response.replace("\\", "");
            if (response.startsWith("\"")){
                response.remove(0, 1);
            }
            if (response.endsWith("\"")){
                response.remove(response.length()-1, 1);
            }
            emit simpleSearchDone(response);
        }else{
            const int httpCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
            qDebug() << "ErrorCode" << httpCode << endl << \
                    "ErrorString" << reply->errorString();
            emit error(httpCode, reply->errorString());
        }
        reply->deleteLater();
        manager->deleteLater();
    }
    

    and QML

    function simpleSearch(response){
        indicator.stop()
        model.clear()
        var json = JSON.parse(response)
        if (json){ // is VALID/PARSED
            model.append(json.search_result)
        }
    }
    

    As I wrote, it is not a good workaround solution. The best is to send VALID JSON string directly from your server. But it works

  • How to encode the string

    Hi I want to send the string encoded on server I do not have now encode this string it please help me.

    Discover your own documentation of the API for URLEncodedPostData.  Who should do it for you.

  • Divide the line into several columns

    Hi all

    I have a question where I want to divide the line into multiple columns based on the delimiter ' |'.

    Staging of Table structure: People_STG, I have people in it.

    Create table People_STG(col1 varchar2(4000));


    Insert into People_STG(Emp_id|) User name | FirstName. LastName. JobTitle | hire_date | Location_id)


    SELECT REGEXP_SUBSTR ( COL1, '[^,|]+', 1, 1) EMP_ID,
           REGEXP_SUBSTR ( COL1, '[^|]+', 1, 2) USERNAME,
           REGEXP_SUBSTR ( COL1, '[^,|]+', 1, 3) FIRSTNAME,
           REGEXP_SUBSTR ( COL1, '[^,|]+', 1, 4) LASTNAME,
           REGEXP_SUBSTR ( COL1, '[^,|]+', 1, 5) JOBTITLE,
           REGEXP_SUBSTR ( COL1, '[^,|]+', 1, 6) HIRE_DATE,
           REGEXP_SUBSTR ( COL1, '[^,|]+', 1, 7) LOCATION_ID
    FROM PEOPLE_STG
    WHERE length(regexp_replace(COL1, '[^|]', '')) = 14;
    

    But I am facing a problem here, as in some lines, function is null, but when I run the above query, it is not recognizing the empty element and inserting Hire_date values of function and location_id in Hire_date where function is null.

    for example: 1 | akash51 | Akaksh | C | 22/11/14 | 15

    Here the function is null, so when I run top to divide query it will insert 11/22/14 in the function column and 15 in Hire_Date.

    Please need help on this one.

    Oracle Version: 11.2 g

    Thanks in advance,

    Akash.

    There are different techniques to cope with this.  Is a simple...

    SQL > ed
    A written file afiedt.buf

    1 with t as (select 1 | akash51 |) Akaksh | C | 22/11/14 | 15' as col1 of union double all the
    2 Select 2 | akash52 | Akaksh | C | Jobs jobs | 23/11/14 | 15' of the double
    3            )
    4  --
    5. end of test data
    6  --
    7 select trim (REGEXP_SUBSTR (COL1, ' [^, |] +', 1, 1)) EMP_ID,.
    8 toppings (REGEXP_SUBSTR (COL1, ' [^, |] +', 1, 2)) USERNAME,.
    9 garnish (REGEXP_SUBSTR (COL1, ' [^, |] +' 1, 3)) FIRSTNAME,
    10 pads (REGEXP_SUBSTR (COL1, ' [^, |] +' 1, 4)) LASTNAME,.
    11 garnish (REGEXP_SUBSTR (COL1, ' [^, |] +' 1, 5)) JOBTITLE,.
    12 pads (REGEXP_SUBSTR (COL1, ' [^, |] +', 1, 6)) HIRE_DATE,.
    13 garnish (REGEXP_SUBSTR (COL1, ' [^, |] +' 1, 7)) location_id
    14 * from (select replace (col1, ' |)) ',' | as col1 of t)
    SQL > /.

    EMP_ID USERNAME FIRSTNAME LASTNAME, JOBTITLE HIRE_DATE LOCATION_I
    ---------- ---------- ---------- ---------- ---------- ---------- ----------
    1 akash51 Akaksh C 22/11/14 15
    2 akash52 Akaksh C Job 23/11/14 15

Maybe you are looking for