just go ask this in an interview it was in javascript
get everything between this two strings (BlogPost and EndBlog while deleting BlogPost and EndBlog obvisouly)
BlogPost
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an
unknown printer took a galley of type and scrambled it to make a type specimen book.
EndBlog
wtf g I tried String(post).match(/BlogPost (.*?) EndBlog/); but kept getting null, in the end i did horrible and this was the first question,
I asked if they can give me fizzbuzz or get the primes under 2million (if they gave me the primes it would have been easy pisy) but they say no can do
wtf /g/ im so lost now how do i solve this or was this design to keep white males like me from getting the job??
>>60167887
Had to do something similar in C# (the superior language) to parse data from an API. see if there's something related to .IndexOf() in Javascript. It finds the index of a specificied string within another string. If this seems helpful to you I'll explain more.
yes in javascript indexOf exist what do i do now master
>>60168574
Are you dumb?
Find index of Blogpost and endblog post and delete everything inbetween
>>60169161
BUT HOW ANON HOW
>>60169625
Parse it you fucking retard
Var begin = str.indexOf('beginBlob')
Var end = str.indexOf('endBlob')
Var newstr = str.substring(0, begin)
newstring += str.substring(end, str.length - end)
console.log(newstr)
>>60169625
You get the index of "BlogPost" and "EndBlog", and in between those is the substring you're interested in
You said the goal was to "get" that substring, that's one way of doing it
on(release);
start.parse(BlogPost);
ignore.miiddel
{
end(EndBlog)}
}}}}
>>60169755
you cant delete everything else on the string because i had to use it for something else also idk about other languages but in javascript you have to do some sht when the string is not in the same line, I got some answer in stackoverflow ill check if it works tomorrow
>>60167887
>javascript
lul
>not realising this is a thinly veiled homework help thread
Come the fuck on.
post.replace(/BlogPost|EndBlog/gi, '').trim()
Wasn't hard. Next.spawn = require('child_process')
text = 'BlogPost Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. EndBlog'
console.log(String(spawn.execSync(`awk -v FS="(BlogPost|EndBlog)" '{print $2}'`, {input: text})))
>>60172291
do it in a browser fucktard
>>60172307
Connect to localhost:5000. Next.spawn = require('child_process')
text = 'BlogPost Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. EndBlog'
require('http').createServer((a, o) => o.end(String(spawn.execSync(`awk -v FS="(BlogPost|EndBlog)" '{print $2}'`, {input: text})))).listen(5000)