Created
September 8, 2020 14:06
-
-
Save danim1130/5f504d4a048008b5ce752c53289ad4ec to your computer and use it in GitHub Desktop.
String functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
//Sztring deklarálás | |
var testSimpleString = "Hello World!"; | |
var testNewLineString = "Hello\r\nWorld!"; | |
var testNewLineRawString = r"Hello\r\nWorld!"; | |
var testMultiLineStringFirst = "Hello " + | |
"World" + | |
"!"; | |
var testMultiLineStringSecond = ''' | |
Hello | |
World | |
! | |
'''; | |
//Sztring műveletek | |
var testString = " 12Hello World!34"; | |
print(testString.split(" ")); | |
print(testString.replaceFirst(" ", "")); | |
print(testString.replaceAll(RegExp(r"\d"), "")); | |
print(testString.padLeft(20)); | |
print(testString.toUpperCase()); | |
print(testString.trim()); | |
//Sztring interpoláció | |
var myNumber = 36; | |
print("Hello $myNumber!"); | |
print("Hello GCD: ${myNumber.gcd(28)}"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment