StringStdc extension
Extension on Stdc to provide <string.h> functionality.
Note: Because Dart strings are immutable, functions that traditionally
mutate a buffer in-place (such as strcpy or strcat) have been adapted
to return the resulting String. You must reassign the result to your variable.
- on
Methods
-
strcat(
String dest, String src) → String -
Available on Stdc, provided by the StringStdc extension
Appends the stringsrcto the end of the stringdest. -
strchr(
String str, String c) → int -
Available on Stdc, provided by the StringStdc extension
Finds the first occurrence of the characterc(given as a String) in the stringstr. -
strcmp(
String str1, String str2) → int -
Available on Stdc, provided by the StringStdc extension
Compares the stringstr1to the stringstr2. Returns 0 if they are equal, a negative value ifstr1is less thanstr2, and a positive value ifstr1is greater thanstr2. -
strcpy(
String dest, String src) → String -
Available on Stdc, provided by the StringStdc extension
Copies the stringsrcintodest. -
strcspn(
String str1, String str2) → int -
Available on Stdc, provided by the StringStdc extension
Calculates the length of the initial segment ofstr1which consists entirely of characters not instr2. -
strlen(
String str) → int -
Available on Stdc, provided by the StringStdc extension
Computes the length of the stringstr. -
strncat(
String dest, String src, int n) → String -
Available on Stdc, provided by the StringStdc extension
Appends up toncharacters from the stringsrcto the end of the stringdest. -
strncmp(
String str1, String str2, int n) → int -
Available on Stdc, provided by the StringStdc extension
Compares up toncharacters of the stringstr1to those of the stringstr2. -
strncpy(
String dest, String src, int n) → String -
Available on Stdc, provided by the StringStdc extension
Copies up toncharacters from the stringsrctodest. -
strpbrk(
String str1, String str2) → int -
Available on Stdc, provided by the StringStdc extension
Finds the first character in the stringstr1that matches any character specified instr2. -
strrchr(
String str, String c) → int -
Available on Stdc, provided by the StringStdc extension
Finds the last occurrence of the characterc(given as a String) in the stringstr. -
strspn(
String str1, String str2) → int -
Available on Stdc, provided by the StringStdc extension
Calculates the length of the initial segment ofstr1which consists entirely of characters instr2. -
strstr(
String haystack, String needle) → int -
Available on Stdc, provided by the StringStdc extension
Finds the first occurrence of the substringneedlein the stringhaystack.