[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

just go ask this in an interview it was in javascript get everything

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 16
Thread images: 1

File: 1fb.png (340KB, 600x583px) Image search: [Google]
1fb.png
340KB, 600x583px
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)
Thread posts: 16
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.