HOW TO SPLIT A STRING

Discussion in 'Requests' started by sattam, Oct 1, 2023.

    
  1. sattam

    sattam Active Member


    Dear Expert,
    I have String Like "45/1/1, NEW BARRACKPORE, NETAJI SUBHASH ROAD, NEW BARRACKPORE, North Twenty Four Parganas, West Bengal, 700131"
    Now I want to split this Into coma separated String like
    1st String- "45/1/1"
    2nd String-"NEW BARRACKPORE"
    3rd String-"NETAJI SUBHASH ROAD"
    4th String-"NEW BARRACKPORE"
    5th String-"North Twenty Four Parganas"
    6th String-"West Bengal"
    7th String-"700131"
    remember this is not a fixed String, String length changes every time
    How to Do this, which function should I use?
    Experts Please help
     


  2. Himanshu-2002

    Himanshu-2002 Active Member


    Create a Function and Use For Token Loop

    Example:

    [Function: Log Address]
    Parameter:pFullAddress: String
    000: For Token:Address:##pFullAddeess:","
    010: Log:##Address
    020: End For
    030: Return
     


  3. sattam

    sattam Active Member


    On: Form Accept : Yes : Form Accept
    On: Form Accept : Yes : Call:Log Address:#MyField

    It shows error

    FUNCTION: 'Log Address' LABEL: 000 : Failed to Parse source string expression '##pFullAddeess'!
     


  4. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Study --- [Function : getGSTeWayBillAddress] in Developer.
     


  5. Himanshu-2002

    Himanshu-2002 Active Member


    1. Just Log this parameter once to check if there is error at variable end
    2. Check For Token Loop in Default, There might be syntax error
     


  6. sattam

    sattam Active Member


    ok let me check
     


  7. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    @sattam -- this should work also - you check the spelling of ADDRESS at Line 000
     
    sattam likes this.


  8. sattam

    sattam Active Member


    ha ha You are right Mr.Amit silly spelling mistake:)
    Thanks Mr Himanshu it works
     


  9. Himanshu-2002

    Himanshu-2002 Active Member


    Your welcome sir :)
     


Share This Page