I need some help to extract a substring out of a string. Right now, my normal string is equal to:
"Einzelzimmer inkl Frühstück - 50,00↵Doppelzimmer inkl Frühstück - 65,00"
Code
var rooms = $('#quote-outbound-hotel-room').text();
if (rooms.indexOf(room) >= 0) {
var roomsToQuote = "The new string created";
$('#quote-outbound-hotel-room').text('');
$('#quote-outbound-hotel-room').text(roomsToQuote);
}
rooms is eqaul to the big string I have showed. room is equal to one room, lets say:
"Einzelzimmer inkl Frühstück - 50,00"
How can I take out the substring room from the original string and return it to the quote?
The roomsToQuote should be the new string I will push to my quote.
Update:
When making an array and splitting it, the array only contains one element with the whole string like:
["Einzelzimmer inkl Frühstück - 50,00↵Doppelzimmer inkl Frühstück - 65,00"]