4 Replies Latest reply on Oct 2, 2006 8:38 PM by Newsgroup_User

    String Manipulation

    golem2
      I need to get the first part only of a string like: "Firstpart*secondpart*thirdpart"
      or: "Firstpart,secondpart,thirdpart"

      Thanks
        • 1. Re: String Manipulation
          golem2 Level 1
          ....more on the wish list:
          I need to get all three parts of the string so:
          input = "Firstpart*secondpart*thirdpart"
          var1 = Firstpart
          var2 - secondpart
          var3= thirdpart
          • 2. Re: String Manipulation
            Level 7
            On Mon, 02 Oct 2006 04:21:28 GMT, golem2 posted in
            macromedia.director.basics:

            > ....more on the wish list:
            > I need to get all three parts of the string so:
            > input = "Firstpart*secondpart*thirdpart"
            > var1 = Firstpart
            > var2 - secondpart
            > var3= thirdpart

            See 'itemDelimiter' in the docs.

            If the number of parts (items) is unknown, you'd be better off creating a
            list of the items rather than trying to set an unknown number of not-yet-
            named variables.


            --
            Mark A. Boyd
            Keep-On-Learnin' :)
            • 3. Re: String Manipulation
              golem2 Level 1
              Thanks.
              But I have used the folowwing:

              thestring = "one^two*three+morestuff"
              var1 = offset("^", thestring)
              varv2 = offset("*", thestring)
              var3 = offset("+", thestring)
              TheFirstPart = n.char [1..var1-1]
              TheSecondPart=n.char [i1+1..var2-1]
              TheThirdPart = n.char [i2+1..var3-1]
              • 4. Re: String Manipulation
                Level 7
                On Mon, 02 Oct 2006 20:56:58 GMT, golem2 posted in
                macromedia.director.basics:

                > Thanks.
                > But I have used the folowwing:
                >
                > thestring = "one^two*three+morestuff"

                Interesting. I don't think I've ever seen the use of multiple delimiters like
                that. Presumably, you have fairly strict control of what can be placed into
                the string itself (nobody will type a * or + in the string, etc.).

                Glad you got it working.


                --
                Mark A. Boyd
                Keep-On-Learnin' :)