Posted By

qrist0ph on 06/04/08


Tagged

cheatSheet stringProcessing


Versions (?)

VBS String Processing


 / Published in: Visual Basic
 

  1. text="1234567890"
  2. WScript.StdOut.WriteLine "World!"
  3. WScript.StdOut.WriteLine Left(text,5)
  4. WScript.StdOut.WriteLine Right(text,5)
  5. WScript.StdOut.WriteLine Mid(text,2,5)
  6. WScript.StdOut.WriteLine Chr(69)
  7. pos=InStr(text,"567")
  8. WScript.StdOut.WriteLine pos
  9. pos=InStrRev(text,"67")
  10. WScript.StdOut.WriteLine pos
  11. WScript.StdOut.WriteLine StrReverse(text)
  12. WScript.StdOut.WriteLine Replace(text,"567","ooo")
  13. WScript.StdOut.WriteLine len(text)
  14. WScript.StdOut.WriteLine StrComp(text,text)
  15. WScript.StdOut.WriteLine StrComp(text,"ddd")
  16. a=Split(text,"3")
  17. WScript.StdOut.WriteLine a(1)
  18. b=Filter(a,"2")
  19. WScript.StdOut.WriteLine a(0)
  20. WScript.StdOut.WriteLine trim (" " & text)

Report this snippet  

You need to login to post a comment.