Results 1 to 3 of 3
  1. #1

    how to sort any string

    I have one weblist in which i have some city name like...


    I want to check whether it is in sorted order or not.means B should be capital letter in Bangalore and rest all letters should be small.How to check for all items n a weblist..
    Please help..

  2. #2

    Re: how to sort any string


    Get the individual text and use toascii() function to check for caps and sorting order.
    I don't build Software but I make them work better, Testing is a Passion

  3. #3

    Re: how to sort any string

    Here's a sample code.

    Dim strChar, strCheck, cnt, breakLoop, ascChar

    strCheck = "Montreal"
    strChar = ""
    cnt = 0
    breakLoop = false
    ascChar = 1

    Do while Not breakLoop
    strChar = Left (strCheck, 1)
    If Len(strCheck) > 0 Then
    strCheck = Right(strCheck, Len(strCheck)-1)
    ascChar = Asc(strChar)
    print "Ascii of "&strChar& ": " & ascChar

    'ascii chars from 65 to 90 are capital letters
    If ascChar < 91 AND ascChar > 64 Then
    If cnt >1 Then
    print "found capital letter: " & strChar &" at string position: " &cnt
    breakLoop = true
    print "first letter is capital. OK"
    End if
    End If
    cnt = cnt +1
    ' checked each char of the string
    print "String is ok."
    breakLoop = true
    End If



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 07:23 PM.

Copyright BetaSoft Inc.