Horje
String Code Example
string
[0]
In computer programming, a string is traditionally a sequence of characters, 
either as a literal constant or as some kind of variable. The latter may 
allow its elements to be mutated and the length changed, or it may be fixed
(after creation). A string is generally considered as a data type and is 
often implemented as an array data structure of bytes (or words) that stores
a sequence of elements, typically characters, using some character encoding.
String may also denote more general arrays or other sequence (or list) data 
types and structures.

Depending on the programming language and precise data type used, a variable
declared to be a string may either cause storage in memory to be statically 
allocated for a predetermined maximum length or employ dynamic allocation to
allow it to hold a variable number of elements.

When a string appears literally in source code, it is known as a string
literal or an anonymous string.

In formal languages, which are used in mathematical logic and theoretical
computer science, a string is a finite sequence of symbols that are chosen 
from a set called an alphabet.

[1]
The string type is used to store a sequence of characters (text). This is not
a built-in type, but it behaves like one in its most basic usage. String 
values must be surrounded by double quotes
string
var string = "Alura";
var resultado = string.substring(1, 4);COPIAR CÓDIGO
string
Concept:
s[x:y:z] , x- left index , y-1 - right index , z is the steps of jumping between 2 chr 

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
string
// for 2 strings s1 and s2 to be anagrams
// both conditions should be True
// 1 their length is same or 
len(s1)==len(s2)
// 2 rearranging chars alphabetically make them equal or 
sorted(s1)==sorted(s2)
String
/*
*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 */
string frase
Hola que tal




Java

Related
what does setFocusable do in java Code Example what does setFocusable do in java Code Example
open google maps cycling navigation intent Code Example open google maps cycling navigation intent Code Example
java coalesce Code Example java coalesce Code Example
android alert change color Code Example android alert change color Code Example
merced A class Code Example merced A class Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7