how to get remove \\ from path value from responseJson
{"records": [{
"id":"1",
"title":"React Native",
"description":"Complete React Native course for advanced",
"instructor":"john",
"chapter":"15",
"assignment":"15",
"fees":"799",
"course":"SampleVideo_1280x720_5mb.mp4",
"thumbnail":"158347549716062111655e61eb296f7fd.jpg",
"path":"http:\/\/localhost:8080\/coursePHP\/upload\/158347549716062111655e61eb296f7fd.jpg"
}]}
this is the json data i am getting i need the url from the path fetchData(){
return fetch('http://192.168.0.104:8080/api/product/displayCourse.php',{
method: 'POST',
headers: {'Accept': 'application/json','Content-Type': 'application/json'},
})
.then((response) => response.json() )
.then( (responseJson) => {
this.setState({
dataSource: responseJson.records
});
//dataurl = JSON.parse(this.responseJson.records.thumbnail);
})
.catch((error) => {
console.error(error.message);
})
}
here try this.
let path = responseJson.records[0].path;
to remove forward slash \\
path = path.replace("\\","");
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.