Total Commander Forum Index Total Commander
Форум поддержки пользователей Total Commander
Сайты: Все о Total Commander | Totalcmd.net | Ghisler.com | RU.TCKB
 
 RulesRules   SearchSearch   FAQFAQ   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Single Post  Topic: Script Request 
Author Message
Batya



PostPosted: Fri Jul 24, 2009 11:39    Post subject: Reply with quote

Tol!k wrote:
Но было бы лучше, если бы одиночные символы не пропадали, а оставались бы в имени файла не считаясь словами

Специально для тебя:
Code:
Function GetSomeWords(pText, pNumWords)
  Dim regEx, lM, lNum
  Set regEx     = New RegExp
  regEx.Pattern = "\S{2,}"
  regEx.Global  = True
  If regEx.Test(pText) Then
    Set lM = regEx.Execute(pText)
    If  lM.Count < pNumWords Then
      lNum = lM.Count
    Else
      lNum = pNumWords
    End If
    GetSomeWords = Left(pText, lM.Item(lNum-1).FirstIndex + Len(lM.Item(lNum-1).Value))
    Set lM = Nothing
  Else
    GetSomeWords = ""
  End If
  Set regEx = Nothing
End Function

_________________
Нет, я не сплю. Я просто медленно моргаю.


Last edited by Batya on Fri Jul 24, 2009 18:19; edited 1 time in total
View user's profile Send private message


Powered by phpBB © 2001, 2005 phpBB Group