所以我从JSON中提取了信息,但我遇到了一些我以前从未见过的东西。这是三个例子。每个例子实际上都是一个大字符串,但我将它拆分,以便我能更好地阅读它。现在我以前从未见过这样的事情,除了在html中。
我要做的是在符号'<>'之间提取文字和'< />”。正如你所看到的,有很多不同的组...统计,计算,br,独特,主动,被动和我。这也是一个有点棘手的地方,因为我发现当有正斜杠时,表示其中一个组已完成,但在统计组内,'br'表示新的统计数据。
有人可以向我解释这些横向克拉是什么吗?是,以及如何在Java中获取它们内部的信息。我以前从未见过这些东西所以我完全失去了。我尝试使用Scanner类,但字符串的设置方式不允许我挑选出每个单词。我会在下面显示我的扫描仪输出,例如1。
谢谢
对不起,如果我在提出这个问题时做得很糟糕,我尽量让一切尽可能清楚
Example 1)
<stats>
+120 Ability Power
</stats>
<br><br>
<unique>UNIQUE Passive:</unique> Increases Ability Power by 30%."
Example 2)
<stats>
+80 Ability Power<br>
+100% Base Mana Regen (+<calc>round(1*stats[BaseManaRegenRate]*5)</calc> Mana per 5 seconds)<br>
+20% Cooldown Reduction
</stats>
<br><br>
<unique>UNIQUE Passive:</unique> Dealing magic damage to enemy champions below 40% Health inflicts Grievous Wounds for 4 seconds.
<br><br>
<i>(Grievous Wounds reduces incoming healing and regeneration effects by 50%.)</i>"
Example 3)
<stats>
+75 Attack Damage<br>
+100% Base Health Regen (+<calc>round(1*stats[BaseHPRegenRate]*5)</calc> Health per 5 seconds)<br>
+12% Life Steal
</stats>
<br><br>
<passive>Passive:</passive> Life Steal applies to damage dealt by this item.<br>
<unique>UNIQUE Passive - Cleave:</unique> Basic attacks deal 20% to 60% of total Attack Damage as bonus physical damage to enemies near the target on hit (enemies closest to the target take the most damage).<br>
<active>UNIQUE Active - Crescent:</active> Deals 60% to 100% of total Attack Damage as physical damage to nearby enemy units (closest enemies take the most damage) (10 second cooldown).
<br><br>
<i>(Unique Passives with the same name don't stack.)</i>"
我在示例1上运行Scanner.next()时的输出
<stats>+120
Ability
Power
</stats><br><br><unique>UNIQUE
Passive:</unique>
Increases
Ability
Power
by
30%.