Answers for "ruby string"

1

string ruby

A String object holds and manipulates an arbitrary sequence of bytes, typically representing characters. String objects may be created using ::new or as literals.

Because of aliasing issues, users of strings should be aware of the methods that modify the contents of a String object. Typically, methods with names ending in “!'' modify their receiver, while those without a “!'' return a new String. However, there are exceptions, such as #[]=.
Posted by: Guest on September-20-2021
1

string ruby

s = String.new
s # => ""
s.encoding # => #<Encoding:ASCII-8BIT>
Posted by: Guest on September-20-2021
0

ruby string trmi

>> @title = "abc"
=> "abc"
>> @title.strip!
=> nil
>> @title
=> "abc"
>> @title = " abc "
=> " abc "
>> @title.strip!
=> "abc"
>> @title
=> "abc"
Posted by: Guest on May-06-2020

Browse Popular Code Answers by Language