Jonatas Paganini wrote:
>
>       @name, @type = *s.split(':')
> 
> Why and where use * before string?
> 

Your statement is equivalent to:

@name, @type = *(s.split(':') )

Here is a simple example:

arr = ["apple", "banana"]
x, y = *arr
puts x, y

--output:--
apple
banana


Or:

s = "hello world"
x, y = *s.split()
puts x, y

--output:--
hello
world


-- 
Posted via http://www.ruby-forum.com/.