# Variables starting with ":"

**URL:** <https://www.ruby-forum.com/t/variables-starting-with/81558>\
**Category:** Ruby\
**Created:** [January 9, 2007, 10:21pm UTC](https://www.ruby-forum.com/t/variables-starting-with/81558 "2007-01-09T22:21:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![escoz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/3d9bf3/32.png) [@escoz](https://www.ruby-forum.com/u/escoz)\
**Post date:** [January 9, 2007, 10:21pm UTC](https://www.ruby-forum.com/t/variables-starting-with/81558/1 "2007-01-09T22:21:11Z")

</div>

Hi guys,

I’ve been looking for information about this for a while on some ruby  
books, and tutorials, but could never find anything.

What’s the diference between regular variables defined as, lets say  
“example”, and the ones defined as “:example” ? If there’s a difference,  
when should each case be used?

In many examples, it’s common to see code that uses variables with the  
:, specially when defining arrays (like cookies[:user\_id] = “abc”)…

I’m sorry for the simple/stupid question… I’ve been studying about ruby  
only for the last week or so.

Thanks a lot!!

Eduardo
