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 string src to the end of the string dest.
strchr(String str, String c) int

Available on Stdc, provided by the StringStdc extension

Finds the first occurrence of the character c (given as a String) in the string str.
strcmp(String str1, String str2) int

Available on Stdc, provided by the StringStdc extension

Compares the string str1 to the string str2. Returns 0 if they are equal, a negative value if str1 is less than str2, and a positive value if str1 is greater than str2.
strcpy(String dest, String src) String

Available on Stdc, provided by the StringStdc extension

Copies the string src into dest.
strcspn(String str1, String str2) int

Available on Stdc, provided by the StringStdc extension

Calculates the length of the initial segment of str1 which consists entirely of characters not in str2.
strlen(String str) int

Available on Stdc, provided by the StringStdc extension

Computes the length of the string str.
strncat(String dest, String src, int n) String

Available on Stdc, provided by the StringStdc extension

Appends up to n characters from the string src to the end of the string dest.
strncmp(String str1, String str2, int n) int

Available on Stdc, provided by the StringStdc extension

Compares up to n characters of the string str1 to those of the string str2.
strncpy(String dest, String src, int n) String

Available on Stdc, provided by the StringStdc extension

Copies up to n characters from the string src to dest.
strpbrk(String str1, String str2) int

Available on Stdc, provided by the StringStdc extension

Finds the first character in the string str1 that matches any character specified in str2.
strrchr(String str, String c) int

Available on Stdc, provided by the StringStdc extension

Finds the last occurrence of the character c (given as a String) in the string str.
strspn(String str1, String str2) int

Available on Stdc, provided by the StringStdc extension

Calculates the length of the initial segment of str1 which consists entirely of characters in str2.
strstr(String haystack, String needle) int

Available on Stdc, provided by the StringStdc extension

Finds the first occurrence of the substring needle in the string haystack.