Max Length

Results 1 to 2 of 2

Thread: Max Length

  1. #1
    Join Date
    Dec 1969

    Default Max Length

    How to find a string with maximum length in an array of strings.<BR><BR> thanks in advance.

  2. #2 Guest

    Default What's so hard about that!

    VBScript:<BR>maxlen=0<BR>maxstr=""<BR>for i=0 to Ubound(MyArr)<BR>&nbsp;&nbsp;&nbsp; if len(MyArr(i)) &#062; maxlen then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; maxstr=MyArr(i)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp; maxlen=len(maxstr)<BR>&nbsp;&nbsp;&nbsp; End If<BR>next<BR><BR>maxstr ends up with the string, and maxlen ends up with its length.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts