Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to extract one string from a local

    Hi, I'm wondering if I can extract one string form a local, for example
    local a `" "AMI" "CFAS" "CFASRA" "'
    di a[2] will give me CFAS

    Thanks!

  • #2
    di a[2] will give me CFAS
    No, it will give you a syntax error, unless you also have a variable named a, in which case it will give you what ever is sin the second observation for that variable. To extract the second "word" from a local macro it would be:

    Code:
    local a `" "AMI" "CFAS" "CFASRA" "'
    display `"`:word 2 of `a''"'

    Comment


    • #3
      Thanks! that's exactly what i want

      Comment

      Working...
      X