Created
December 15, 2021 06:47
-
-
Save rozer007/46726131f7101a10bd6fd04b3ec4ba45 to your computer and use it in GitHub Desktop.
String in julia
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
Q1. Are string mutable in julia? | |
ans: No They are immutable. | |
Q2. How is the indexing of string in julia different from other language? | |
ans: In julia the indexing start from 1 whereas in other languages it start from 0. | |
Q3.How can we access the last character of a string? | |
ans: We can use the end keyword to access the last character of a string. | |
Q4.What is the occurin string use for? | |
ans: The occurin function is use to check whether a substring is present in a string or not. | |
Q5. What is the syntax of multiline string in julia? | |
ans: Syntax: """ content """ |
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
Q1. What will the output of the statement? | |
str="Pepcoder" | |
println(str[0]) | |
a) P | |
b) r | |
c) Pepcoder | |
d) None of the above | |
ans: d) | |
Q2. What will the output of the statement? | |
println("Azazzz" > "Azzzz") | |
a) True | |
b) False | |
c) Error | |
d) None of the above | |
ans: b) | |
Q3.What will be the output? | |
s="12" | |
t="21" | |
println(s*t) | |
a) 33 | |
b) 2112 | |
c) 1221 | |
d) None of the above | |
ans: c) | |
Q4.What will be the correct output? | |
str="pepcoder or Non pepcoder" | |
println(str[13:end]) | |
a) Pepcoder or | |
b) Non | |
c) Non pepcoder | |
d) error | |
ans: c) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment