Skip to content

Coder Tutorial

Menu
  • Home
  • HTML
  • CSS
  • PHP
  • SQL
  • MySQL
  • JS
  • PL/SQL
  • Python
  • Java
  • Oracle
Home
Ruby
Ruby Next statement

Ruby Next statement

Ruby Next statement

The Ruby Next statement is used to skip the rest of the current iteration.

Next Statement syntax

next

Next Statement example

for x in 1..5
   if x < 4 then
      next
   end
   puts "The value of x = #{x}"
end

Output

The value of x = 4

The value of x = 5

Tutorials

  • Ruby Tutorial
  • Ruby Variables
  • Ruby Strings
  • Ruby Date and Time
  • Ruby Array
  • Ruby Hashes
  • Ruby Ranges
  • Ruby If-Elsif-Else
  • Ruby Case
  • Ruby For Loop
  • Ruby While Loop
  • Ruby Until Loop
  • Ruby Each Loop
  • Ruby Next Statement
  • Ruby Break Statement
  • Ruby Return statement
  • Ruby Methods
  • Ruby Blocks
  • Ruby Exceptions

Recent Posts

  • Java Polymorphism
  • Java Encapsulation
  • Java Abstraction
  • PostgreSQL ERROR: cannot begin/end transactions in PL/pgSQL
  • PostgreSQL Column must appear in the GROUP BY clause
  • PostgreSQL Column specified more than once
  • PostgreSQL Create database, Alter database examples
  • PostgreSQL Create schema syntax, Alter schema
  • PostgreSQL Create database user, alter and drop username
  • PostgreSQL Alter table name. Modify column name
Coder Tutorial Copyright © 2025. | Privacy Policy
Back to Top ↑
x