Advertisement
Guest User

Pony substring / contains

a guest
Jun 7th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. actor Main
  2.   new create(env: Env) =>
  3.  
  4.     let imageEndings:Array[String val] val = [".jpg";".png";".bmp";".gif"]
  5.     env.out.print("String in Array "+imageEndings.contains(".png").string())
  6.     //Prints: String in Array true
  7.     let endPng:String val = ".png"
  8.     env.out.print("Let in Array "+imageEndings.contains(".png").string())
  9.     //Prints: Let in Array true
  10.     let imageName ="testing.png"
  11.     let size=imageName.size().isize()
  12.     let ending:String val = recover val imageName.substring(size-4, size).lower() end
  13.     env.out.print("Ending "+ending.clone()+" "+ending.size().isize().string()+" "+imageEndings.contains(ending).string())
  14.     //BUT, this prints: Ending .png 4 false
  15.     //What's going on with substring?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement