Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • next Statement in Ruby

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 179
    Comment on it

    By using next statement, control will go to next iteration of the loop.
    Terminates the execution of a block if it will be called in that block.

    Example

    for i in 0..8
       if i < 3 then
          next
       end
       puts "Value of i is #{i}"
    end
    

    This will produce the following result:

    Value of i is 3
    Value of i is 4
    Value of i is 5
    Value of i is 6
    Value of i is 7
    Value of i is 8

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: