優先使用 字符串插值 來代替 字符串串聯。
# bad email_with_name = user.name + ' <' + user.email + '>' # good email_with_name = "#{user.name} <#{user.email}>" # good email_with_name = format('%s <%s>', user.name, user.email) Consider padding string interpolation code with space. It more clearly sets the
code apart from the string.考慮使用空格填充字符串插值。它更明確了除字符串的插值來源。
"#{ user.last_name }, #{ user.first_name }" Consider padding string interpolation code with space. It more clearly sets the
code apart from the string.
考慮替字符串插值留白。
主站蜘蛛池模板:
蓬莱市|
石棉县|
通州区|
涿州市|
蓝田县|
闽侯县|
嘉荫县|
廉江市|
开远市|
吕梁市|
南昌县|
独山县|
栾城县|
项城市|
筠连县|
大方县|
仁怀市|
阳西县|
缙云县|
浦江县|
双鸭山市|
长岭县|
花莲县|
平罗县|
东乡县|
贵阳市|
博湖县|
仪征市|
庆云县|
响水县|
孝义市|
石景山区|
双柏县|
大同县|
湘阴县|
海口市|
南安市|
遵化市|
赤城县|
垣曲县|
旌德县|