Commit 7ce5b21c authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #2931 from Mav7/master

Updated string.h.md
parents 64d7dec4 8ad8c547
## Macros
### mrb_str_ptr(s)
Returns a pointer from a Ruby string.
## Functions
### mrb_str_plus ### mrb_str_plus
```C ```C
mrb_value mrb_str_plus(mrb_state*, mrb_value, mrb_value); mrb_value mrb_str_plus(mrb_state*, mrb_value, mrb_value);
...@@ -43,3 +47,45 @@ Duplicates a string object. ...@@ -43,3 +47,45 @@ Duplicates a string object.
mrb_value mrb_str_intern(mrb_state *mrb, mrb_value self); mrb_value mrb_str_intern(mrb_state *mrb, mrb_value self);
``` ```
Returns a symbol from a passed in string. Returns a symbol from a passed in string.
### mrb_str_to_str
```C
mrb_value mrb_str_to_str(mrb_state *mrb, mrb_value str);
```
Returns a converted string type.
### mrb_str_equal
```C
mrb_bool mrb_str_equal(mrb_state *mrb, mrb_value str1, mrb_value str2);
```
Returns true if the strings match and false if the strings don't match.
### mrb_str_cat
```C
mrb_value mrb_str_cat(mrb_state *mrb, mrb_value str, const char *ptr, size_t len);
```
Returns a concated string comprised of a Ruby string and a C string.
### mrb_str_cat_cstr
```C
mrb_value mrb_str_cat_str(mrb_state *mrb, mrb_value str, mrb_value str2);
```
Returns a concated string comprised of a Ruby string and a C string(A shorter alternative to mrb_str_cat).
### mrb_str_append
```C
mrb_value mrb_str_append(mrb_state *mrb, mrb_value str, mrb_value str2);
```
Adds str2 to the end of str1.
### mrb_str_cmp
```C
int mrb_str_cmp(mrb_state *mrb, mrb_value str1, mrb_value str2);
```
Returns 0 if both Ruby strings are equal.
Returns a value < 0 if Ruby str1 is less than Ruby str2.
Returns a value > 0 if Ruby str2 is greater than Ruby str1.
### mrb_str_to_cstr
```C
char *mrb_str_to_cstr(mrb_state *mrb, mrb_value str);
```
Returns a C string from a Ruby string.
### mrb_str_inspect
```C
mrb_str_inspect(mrb_state *mrb, mrb_value str);
```
Returns a printable version of str, surrounded by quote marks, with special characters escaped.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment