Mailtraq - the Complete Email Server
   

Enstar for Mailtraq email server sales & support
Making world-class Internet technology affordable  

Search for:

Advanced search

SubStr()

Returns a substring taken from the given string. The position and length of the required substring are given as parameters.

sub := SubStr( string , index , length )

sub
The resulting substring
string
The string from which a substring is to be extracted
index
The index offset, commencing at one, of the first character to extract from the string
length
The number of characters to extract
// Extract "some" from "This is some text"
"some" := Substr("This is some text", 9, 4)

// Rewrite References header to ensure whitespace between all msg-id
ref_list := Header("References");
If(WildcardMatch(ref_list, "*><*"),
  Do(
    rev_list := "",
    i := 1,
    While(i <= Length(ref_list),
    Do(
      rev_list := If(Length(rev_list) > 0, rev_list) ++ 
          SubStr(ref_list, i, 1) ++ 
          If(SubStr(ref_list, i, 1) = ">", " "),
        i := i + 1
      )
    ),
    SetHeader("References", rev_list)
  )
)
Mailtraq Highlights...
 SMTP Server     Mailtraq SMTP email server video IMAP Server     Mailtraq IMAP email Server video
 POP3 Server     Mailtraq POP3 email server video Proxy Server     Mailtraq proxy email server video
 Webmail Server     Mailtraq webmail email server video Mailing-list Server     Mailing list email server video
 Groupware Services     Mailtraq groupware email services video Spam and Virus control     Spam and virus control email server video

 

   Copyright © 2003 - 2011 Enstar Ltd, Enstar LLC & Fastraq Ltd. All rights reserved. Privacy policy.
   Mailtraq® is a registered trademark of Fastraq Limited.