substring.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. function test(v)
  6. {
  7. v = v.substring(7,15);
  8. switch (v)
  9. {
  10. case "string0s":
  11. WScript.Echo("string0s");
  12. break;
  13. case "string1s":
  14. WScript.Echo("string1s");
  15. break;
  16. case "string2s":
  17. WScript.Echo("string2s");
  18. break;
  19. case "string3s":
  20. WScript.Echo("string3s");
  21. break;
  22. case "string4s":
  23. WScript.Echo("string4s");
  24. break;
  25. default:
  26. WScript.Echo("ERROR: " + v);
  27. break;
  28. };
  29. }
  30. for (var i = 0; i < 5; i++)
  31. {
  32. test("prefix_string" + i + "suffix");
  33. }