Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1 @@
def string = 'Able was I'

View file

@ -0,0 +1,6 @@
def gString = "${string} ere I saw Elba"
println gString
//Outputs:
//Able was I ere I saw Elba

View file

@ -0,0 +1,5 @@
def gString2 = "1 + 1 = ${1 + 1}"
assert gString2 == '1 + 1 = 2'
def gString3 = "1 + 1 = \${1 + 1}"
assert gString3 == '1 + 1 = ${1 + 1}'

View file

@ -0,0 +1,20 @@
def multiLineString = '''
A man
A plan
A canal
'''
def multiLineGString = """
${multiLineString.trim()}:
Panama!
"""
println multiLineGString
//Outputs:
//
//A man
//A plan
//A canal:
//Panama!
//

View file

@ -0,0 +1,3 @@
def regexString = /(\[[Tt]itle\]|\[[Ss]ubject\])${10 * 5}/
assert regexString == '(\\[[Tt]itle\\]|\\[[Ss]ubject\\])50'

View file

@ -0,0 +1,8 @@
assert 'a' instanceof String
assert ('a' as char) instanceof Character
assert ((char)'a') instanceof Character
char x = 'a'
assert x instanceof Character
Character y = 'b'
assert y instanceof Character && (x+1 == y)

View file

@ -0,0 +1,2 @@
def quote = "\""
def apostrophe = '\''

View file

@ -0,0 +1,4 @@
def quote2 = '"'
def apostrophe2 = "'"
assert quote == quote2
assert apostrophe == apostrophe2