此正则表达式:
str.replace(/ +/g, '-').toLowerCase();
将转换为以下内容:
The dog jumped over the lazy - chair
如下所示:
the-dog-jumped-over-the-lazy---chair
如何修改它,使其生成以下内容(只有一个连字符):
the-dog-jumped-over-the-lazy-chair
我正在读“入门”。我对YAML配置文件非常垂头丧气:
scrape_configs:
- job_name: 'node'
# Override the global default and scrape targets from this job every 5 seconds.
scrape_interval: 5s
static_configs:
- targets: ['localhost:8080', 'localhost:8081']
labels:
SQL注释字符由两个连字符组成,因此: -- cannot create table if one already exists
drop table if exists mytable; 在源代码的包列表中使用lstlisting时,注释字符将转换为连字符。如果我在连字符之间插入一个空格,它看起来就像连字符,而不是相邻的两个连字符。那么,在SQL源代码的包列表中使用lstlistings,如何指定注释字符?