“chaîne de caractères” Réponses codées

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

Chaîne de caractères

/*
*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

chaîne de caractères

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

chaîne de caractères

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

frase de chaîne

Hola que tal
Silly Sardine

Cordes

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

Réponses similaires à “chaîne de caractères”

Questions similaires à “chaîne de caractères”

Plus de réponses similaires à “chaîne de caractères” dans Python

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code