Javascript 如何在react应用程序上提取json中段落内的特定句子?
我想在react应用程序的Json中提取一个段落中的特定句子。比如说-Javascript 如何在react应用程序上提取json中段落内的特定句子?,javascript,html,json,reactjs,Javascript,Html,Json,Reactjs,我想在react应用程序的Json中提取一个段落中的特定句子。比如说- groupinfo: this is the groups info errorInfo: "imagine this is a long paragraph within a Json file, and i want to display/pull just a small part of it. so for instance i want just (long paragraph) and I want to kno
groupinfo: this is the groups info
errorInfo: "imagine this is a long paragraph within a Json file, and i want to display/pull just a small part of it. so for instance i want just (long paragraph) and I want to know how to just pull that one part of the paragraph"
我想用段落的这一小部分来完成一个weblink,因此它使用的小句子需要是可变的,并根据json中的artifactID来确定
那么,如果这是可行的,它将只提取Json中段落的一小部分,并将其显示为指向网站的链接。如果我需要做更多的解释,让我知道。如果你用子字符串得到它怎么办
const myStr = 'Alligator';
const myNewStr = myStr.substring(0, 3);
console.log(myNewStr); // All