我有json文件,其中包含以下平行线。 我需要找到并递增最后一个数字" 1.39.25.1"像红宝石代码那样1.39.25.2,1.39.25.3。
"appVersion": {
"buildFlavour": "varation",
"customisation": "MY.VER.NUM",
"version": "1.39.25.1"
},
请帮助解决此问题
答案 0 :(得分:1)
String#succ是一种快速简便的方法:
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" rel="stylesheet"/>
<div class="test d-flex flex-column">
<ul class="list-group h-100">
<li class="list-group-item">Cras justo odio</li>
<li class="list-group-item">Dapibus ac facilisis in</li>
<li class="list-group-item">Morbi leo risus</li>
<li class="list-group-item">Porta ac consectetur ac</li>
<li class="list-group-item">Vestibulum at eros</li>
<li class="list-group-item">Cras justo odio</li>
<li class="list-group-item">Dapibus ac facilisis in</li>
<li class="list-group-item">Morbi leo risus</li>
<li class="list-group-item">Porta ac consectetur ac</li>
<li class="list-group-item">Vestibulum at eros</li>
<li class="list-group-item">Cras justo odio</li>
<li class="list-group-item">Dapibus ac facilisis in</li>
<li class="list-group-item">Morbi leo risus</li>
<li class="list-group-item">Porta ac consectetur ac</li>
<li class="list-group-item">Vestibulum at eros</li>
<li class="list-group-item">Cras justo odio</li>
<li class="list-group-item">Dapibus ac facilisis in</li>
<li class="list-group-item">Morbi leo risus</li>
<li class="list-group-item">Porta ac consectetur ac</li>
<li class="list-group-item">Vestibulum at eros</li>
</ul>
<div>
答案 1 :(得分:0)
*others, last = "1.39.25.1".split(".")
[*others, last.next].join(".")
# => "1.39.25.2"