fix some file extensions
This commit is contained in:
parent
68f8f3e56b
commit
f3a896c724
789 changed files with 91 additions and 62 deletions
18
Task/Palindrome-detection/VBScript/palindrome-detection-1.vb
Normal file
18
Task/Palindrome-detection/VBScript/palindrome-detection-1.vb
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
function Squish( s1 )
|
||||
dim sRes
|
||||
sRes = vbNullString
|
||||
dim i, c
|
||||
for i = 1 to len( s1 )
|
||||
c = lcase( mid( s1, i, 1 ))
|
||||
if instr( "abcdefghijklmnopqrstuvwxyz0123456789", c ) then
|
||||
sRes = sRes & c
|
||||
end if
|
||||
next
|
||||
Squish = sRes
|
||||
end function
|
||||
|
||||
function isPalindrome( s1 )
|
||||
dim squished
|
||||
squished = Squish( s1 )
|
||||
isPalindrome = ( squished = StrReverse( squished ) )
|
||||
end function
|
||||
Loading…
Add table
Add a link
Reference in a new issue