Author Topic: String manipulation  (Read 3475 times)

bekiricli

  • New Community Member
  • Posts: 1
  • Hero Points: 0
String manipulation
« on: December 05, 2008, 07:32:29 am »
Hi all,

I'm a newbee in SE Macro Programming and I'd like to be able to extract individual characters in a given string.
For example, I get the file name with p_buf_name and wanna extract only the file name and extension.
Could anybody help me?

Best regards,
Bekir

Graeme

  • Senior Community Member
  • Posts: 2484
  • Hero Points: 325
Re: String manipulation
« Reply #1 on: December 05, 2008, 08:51:28 am »
See the strip_filename function in the help.

Also, in help -> contents -> macro functions by category -> string functions  - see sub_str, pos.
Another useful function  - maybe_quote_filename.
Also, if you haven't seen it, in the installation docs folder there is SlickCMacroBestPractices.pdf.

Graeme

Edit  - sub_str should have the underscore removed.  For some reason, the forum software doesn't accept a post that has s u b s t r (no underscore) in it.

« Last Edit: December 05, 2008, 08:53:05 am by Graeme »