CopyWord
Top  Previous  Next


Returns a delimited part of a string

CopyWord (Source, Delimiter, Word, MinWords)

Source
Source string  

Delimiter
Delimiter between words  

Word
Word to copy  
 
1=First word, 2=Second word, 128=Last word (independent of number of words)  

MinWords
Minimum number of words in source string in order to return something  
 
0=no minimum  

Example
[Settings_Begin]
BatchSettings.MarkersAutoRemove=Yes
[Settings_End]

[Batch_Begin]
Set Name=MICKEY M MOUSE   
Set FullName=ProperCaseName(%Name%)   
Set FirstName=CopyWord(%FullName%, ,1,0)   
Set LastName=CopyWord(%FullName%, ,128,0)   
Set Initials=CopyWord(%FullName%, ,2,3)   
Set DottedName=Lowercase(%FirstName%.%LastName%)   
Set CommonName=%LastName%\, %FirstName%
MessageBox "FullName:%FullName% | DottedName:%DottedName% | FirstName: %FirstName% | LastName: %LastName% | Initials: %Initials% | CommonName: %CommonName%"   
[Batch_End]


Displays "FullName:Mickey M Mouse | FirstName: Mickey | LastName: Mouse | Initials: M | DottedName:mickey.mouse | CommonName: Mouse\, Mickey"