# As programmers say: Strive to be lazy

## Story

Have you seen this post from 9gag? Maybe you got the feeling to make your own sentences. But then you realize that you could just golf a script in half an hour, and you will never have to deal time with that.

## The submission

Your program will get an input string which it will return with added quotation marks as explained below. Standard loopholes are forbidden. Output as a list of lines is allowed. Trailing spaces and empty lines that don't break the output are allowed.

## The rules of input

• The input only contains printable ASCII characters.
• The input may contain spaces. The words are determined with them.
• It's guaranteed that a space will never be followed by another space.
• The case of no input or empty string doesn't matter.

## The rules of output

If one word is given then the program has to return the string between quotation marks.

If the input string has 2 or more words, it first returns the initial input, but the first word is in quotation marks. Then on the next line, it returns the initial input, but with the second word in quotes. And so on for the remaining words.

In general, the program has to return as many lines as there are words in the input.

## Examples:

test -> "test"

This is codegolf -> "This" is codegolf
This "is" codegolf
This is "codegolf"

This is a significantly longer, but not the longest testcase -> "This" is a significantly longer, but not the longest testcase
This "is" a significantly longer, but not the longest testcase
This is "a" significantly longer, but not the longest testcase
This is a "significantly" longer, but not the longest testcase
This is a significantly "longer," but not the longest testcase
This is a significantly longer, "but" not the longest testcase
This is a significantly longer, but "not" the longest testcase
This is a significantly longer, but not "the" longest testcase
This is a significantly longer, but not the "longest" testcase
This is a significantly longer, but not the longest "testcase"

Here is an another one -> "Here" is an another one
Here "is" an another one
Here is "an" another one
Here is an "another" one
Here is an another "one"


This is , so the least byte answer wins!

• Will there be duplicate words? May 10 '19 at 22:26
• Can we assume the input string will not contain " characters?
– Doorknob
May 10 '19 at 23:00
• Re "Strive to be lazy": I think this is a misrepresentation of what Larry Wall said. - "Most folks see laziness as a synonym for slacker or couch potato, but Wall's definition is about efficiency." May 11 '19 at 2:47
• This "problem" should be "fun" to "golf". May 11 '19 at 6:26
• Can we use different quotes, like '', ‘’, or “”, rather than ""? May 13 '19 at 17:59

ḲçⱮL$ Try it online! Thanks to @JonathanAllan for saving 4 bytes • I'm pretty sure you need to count the Y unless you get the OP to allow a list of lines as function output. You can then save 4 like this (although mine is then just a one Link version of that). May 11 '19 at 11:07 • @JonathanAllan it says a list of lines is ok as output. I’ve added in your improvements - hope that’s ok. Thanks. May 11 '19 at 11:15 • Ah so it does! :) May 11 '19 at 11:54 # Python 3, 107 bytes import re def f(s): for w in re.finditer('[^ ]+',s):p=w.span();print(f'{s[:p[0]]}"{w.group()}"{s[p[1]:]}')  Try it online! I... decided to use regex against my better judgement. This is the result. # J, 45 bytes  f =: ' 'joinstring"1(](dquote&.>])@.=($~$@=))@cut f 'this is a test string' "this" is a test string this "is" a test string this is "a" test string this is a "test" string this is a test "string"  If the input can be a list of boxes, then my solution can be 30 bytes:  f =: (](dquote&.>])@.=($~$@=))@cut f 'this is a test' ┌──────┬────┬───┬──────┐ │"this"│is │a │test │ ├──────┼────┼───┼──────┤ │this │"is"│a │test │ ├──────┼────┼───┼──────┤ │this │is │"a"│test │ ├──────┼────┼───┼──────┤ │this │is │a │"test"│ └──────┴────┴───┴──────┘  • +1 from me, but I think you need to make it a verb to comply with the PPCG rules: Try it online: May 13 '19 at 10:53 • Ah I didn't realize that was a rule. Fixed. May 13 '19 at 12:58 # Oracle SQL, 92 bytes select regexp_replace(s,'(\S+)','"\1"',1,level)from t connect by level<regexp_count(s,' ')+2  Assuming there is a table in a form create table t as select 'This is a significantly longer, but not the longest testcase' s from dual;  Test in SQL*Plus SQL> select regexp_replace(s,'(\S+)','"\1"',1,level)from t connect by level<regexp_count(s,' ')+2 2 / REGEXP_REPLACE(S,'(\S+)','"\1"',1,LEVEL) -------------------------------------------------------------------------------- "This" is a significantly longer, but not the longest testcase This "is" a significantly longer, but not the longest testcase This is "a" significantly longer, but not the longest testcase This is a "significantly" longer, but not the longest testcase This is a significantly "longer," but not the longest testcase This is a significantly longer, "but" not the longest testcase This is a significantly longer, but "not" the longest testcase This is a significantly longer, but not "the" longest testcase This is a significantly longer, but not the "longest" testcase This is a significantly longer, but not the longest "testcase" 10 rows selected.  # SNOBOL4 (CSNOBOL4), 93 bytes  S =' ' I =INPUT S S I ARB . R S REM . I :F(END) OUTPUT =L '"' R '"' S I L =L R S :(S) END  Try it online! Each line ends with an additional space. # Python 2, 108 bytes def f(s): W=s.split();n=len(W) for x in range(n*n):print[W[x%n],'"'+W[x%n]+'"'][x%-~n==0]+'\n'*(x%n==n-1),  Try it online! # PHP, 134 bytes <?php$i=explode(' ',file_get_contents('php://stdin'));for($x=0;$x<count($i);$x++){$o=$i;$o[$x]='"'.$i[$x].'"';echo join(' ',\$o).'