str/underscored

将驼峰形式或者是以下划线为分界的字符串转换成以为破折号分界的字符串。
Source:
Example
str.dasherize('the_dasherize_string_method')     // 'the-dasherize-string-method'
str.dasherize('the dasherize string method')     // 'the-dasherize-string-method'
str.dasherize('TheDasherizeStringMethod')       // '-the-dasherize-string-method'
str.dasherize('thisIsATest')                     // 'this-is-a-test'
str.dasherize('this Is A Test')                  // 'this-is-a-test'
str.dasherize('thisIsATest123')                  // 'this-is-a-test123'
str.dasherize('123thisIsATest')                  // '123this-is-a-test'
Parameters:
Name Type Description
str String 驼峰形式或者是以下划线为分界的字符串
Returns:
破折号为分界的字符串
Type
String
Source:
Example
str.underscored('the-underscored-string-method')   // 'the_underscored_string_method'
str.underscored('theUnderscoredStringMethod')      // 'the_underscored_string_method'
str.underscored('TheUnderscoredStringMethod')      // 'the_underscored_string_method'
str.underscored(' the underscored  string method') // 'the_underscored_string_method'
Parameters:
Name Type Description
str String 驼峰形式或者是以破折号为分界的字符串
Returns:
下划线为分界的字符串
Type
String
将驼峰形式或者是以破折号为分界的字符串转换成以下划线为分界的字符串。
Source:
Example
str.dasherize('the_dasherize_string_method')     // 'the-dasherize-string-method'
str.dasherize('the dasherize string method')     // 'the-dasherize-string-method'
str.dasherize('TheDasherizeStringMethod')       // '-the-dasherize-string-method'
str.dasherize('thisIsATest')                     // 'this-is-a-test'
str.dasherize('this Is A Test')                  // 'this-is-a-test'
str.dasherize('thisIsATest123')                  // 'this-is-a-test123'
str.dasherize('123thisIsATest')                  // '123this-is-a-test'
Parameters:
Name Type Description
str String 驼峰形式或者是以下划线为分界的字符串
Returns:
破折号为分界的字符串
Type
String
Source:
Example
str.underscored('the-underscored-string-method')   // 'the_underscored_string_method'
str.underscored('theUnderscoredStringMethod')      // 'the_underscored_string_method'
str.underscored('TheUnderscoredStringMethod')      // 'the_underscored_string_method'
str.underscored(' the underscored  string method') // 'the_underscored_string_method'
Parameters:
Name Type Description
str String 驼峰形式或者是以破折号为分界的字符串
Returns:
下划线为分界的字符串
Type
String