how to remove(strip) a character?


    Oct 17 2009 | 5:58 am
    Dear users,
    I want get only one letter from a string. E.g.: From Input1 just 1 From Output2 just 2
    Does it work in MAX?
    best, prko

    • Oct 17 2009 | 7:22 am
      Have a look at [regexp], it's a bit complicated to understand but if you google "regular expressions" there are some excellent tutorials/manuals on the web.
      lh
    • Oct 17 2009 | 11:10 am
      thanks!
    • Oct 27 2009 | 6:07 am
      This works as well and is easier to understand than regexp...
    • Oct 30 2009 | 11:25 pm
      Hi ! I second thereishopeforus, regexp is a lot more powerful when well used.Here is another example and another solution.
    • Oct 30 2009 | 11:32 pm
      Thanks! I understand now the regexp better!!!! It is very wonderful explanation.
    • Oct 30 2009 | 11:38 pm
      My pleasure, happy to help
    • Nov 04 2009 | 7:44 am
      one more question!
      how can I get only numbers from the following two stirings?
      symbol "1, 2, 3, 4, 5, 6, 7, 8"
      and
      symbol "1 2 3 4 5 6 7 8"
      Regretfully, I have not found the syntax for this case....
      best, prko
    • Nov 04 2009 | 8:27 am
      Try [regexp , @substitute " "] for the first example, replacing ,commas, with spaces. The second case just needs a [fromsymbol].
      lh
    • Nov 04 2009 | 9:40 pm
      Thanks!
      My solution is as follows:
    • Nov 04 2009 | 11:58 pm
      Be warned that your example will only work for single digit numbers, if your list was "23 -6 3.1415" it wouldn't work. Try something like [regexp -?\d+\.?\d*] to check for larger numbers, negatives and decimals, if you need to.
      lh