“Saite” Code-Antworten

Stringvar

#declare variable -->
var = StringVar()
#sets variable to what ever(most the time a string)
var.set("hello")
#this is used in tkinter!
Fragile Ferret

Saite

/*
*NOTICE: the 2 variables refer to one place in memory no 2 different, 
because both of them have the same value.
*/
String str1 = "Hello";
String str2 = "Hello";
/* if I changed value of each one will not share the common place. */
String str2 = "HELLO";
/* Now, both of them has different place in memory */
Helpless Hamster

Saite

Concept:
s[x:y:z] , x- left index , y-1 - right index 
z is the number of steps of jumping between 2 chr 
if z>0 :
    direction of jump is right to left(R2L)
else:
    direction of jump is left to right(L2R)
s[:3] means x=0,y=2,z=1
s[3:] means x=3,y=len(s)-1,z=1

examples:

s="dbdhdhndnbdd"
print(s[2:6:2])
//prints dd as left index is 2 right is 5 -> substring is dhdh & 2 means d,skip h,then d
s="djdjcjfd"
print(s[::-2])
//prints djjj, left index is 0 ,right is len(s)-1 -> substring is djdjcjfd & 
//-2 means start from right side in substring in steps of 2-> d,skip f,then j,skip c,then j & j
ap_Cooperative_dev

Saite

var string = "Alura";
var resultado = string.substring(1, 4);COPIAR CÓDIGO
Lucas Emanoel

Saiten

var greeting = 'Hi buddy';
var message = 'You are doing great! Keep studying!';
Sleepy Scarab

@STRING

In Android, @string refers to all the strings in the strings.xml file
Rouni Gorgees

Ähnliche Antworten wie “Saite”

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen