Want to get rid of Google Ads, click here.
+ Reply to Thread
Results 1 to 6 of 6

Thread: Spliting out a string

  1. #1
    Member
    Join Date
    Nov 2001
    Location
    Boston, MA - United States
    Posts
    79

    Default

    Hi all,



    Does any have any idea on how to split out part of a string in Connect.It?



    I have a string like this:



    /PHS/Information Systems/Network Services/



    and I need to break the PHS out of that string so that I can put it into another field. In VBScript I could use the split(Institution, "/") which would split it out into an array. But I can't seem to find anything equilvent in Connect.It



    I tried the LeftPart function ..

    LeftPart(Dept, "/")



    but this just returns an empty string since there is a preceding /



    Any thoughts?



    thanks, Aaron

  2. #2
    Administrator tommy's Avatar
    Join Date
    Nov 2001
    Location
    Copenhagen
    Posts
    4,272

    Default

    I have worked a litle with these functions.



    I tried several of the functions leftpart, leftpartfromright, rightpart, rightpartfromleft and so on.



    I know that one of the functions does not work in COIT 2.60 ( I can't remember which one sorry)



    Anyway You probably need a combination of several of the functions. I don't have COIT installed on my laptop at the moment so I can't give you an example.



    You know that the mails from change module has a subject that is not exactly nice. I have used several of these functions to strip off all unwanted information so that only the brief description from the change is in the subject, so it can be done.



    Try this one:



    RightPartFromLeft(LeftPartFromRight(LeftPartFromRi ght(LeftPartFromRight(Dept, "/"), "/"), "/"), "/")



    Don't shoot me if I got it wrong, but I think You get the idea.







    btw check the manual for the exact names of the functions (above is from memory).



    [Edited by admin on 28-03-2002 at 22:22 GMT]

  3. #3
    Member
    Join Date
    Nov 2001
    Location
    Boston, MA - United States
    Posts
    79

    Default

    thanks Tommy..



    I managed to get it working:



    DIM Mystr, fullname, Dept

    fullname = [Parent.FullName]

    Mystr = ExtractValue(fullname, "/")

    Dept = LeftPart(fullname, "/" )

    RetVal = Dept



    The extractValue statement removed the preceding slash and then I was able to use the LeftPart Statement successfully to retrieve the value I wanted.




  4. #4
    Administrator tommy's Avatar
    Join Date
    Nov 2001
    Location
    Copenhagen
    Posts
    4,272

    Default

    Great, the function ExtractValue what does it do?



    Does it remove the first occurence of the value in the string?

  5. #5
    Member
    Join Date
    Nov 2001
    Location
    Boston, MA - United States
    Posts
    79

    Default

    you got it.. It removed the first / that was preventing me from using LeftPart.

  6. #6
    Junior Member
    Join Date
    Dec 2008
    Posts
    21

    Default

    ExtractValue,

    This helped me as well!

    Thanks,
    dulo

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts