Str converts a number to a string.
<?php $str = "1234567"; $strArr = str_split($str); //split up $str by 1 character $strlen = strlen($str) - 1; //get length of $str - 1 since the $strArr starts at 0 for($i=$strlen;$i>=0;$i--) { echo $strArr[$i]; } ?>
It doesn't discuss.
By using "str()". Example: number = 2 yourNumber = print("Your number is %s!") % (str(number))
Syntax: #include int puts( char *str );The function puts() writes str to stdout, then writes a newline character. puts() returns non-negative on success, or EOF on failure.
$str = "Hello"; $nameArr=str_split($str); print_r($nameArr); echo "length: ".count($nameArr);
We'll use a simple method of encryption: xor encryption // same function used to both encrypt and decrypt void crypt(char *str) { const int key = 0x86; // crypt each individual character of str int i; const int length = strlen(str); for(i = 0; i < strlen(str); ++i) { str[i] = str[i] ^ key; } }
char * RevString( char * str ){char * dup = strdup( str );size_t len = strlen( str );int x = 0;int y = len;while( x
#include<stdio.h> #include<conio.h> #include<string.h> int main() { int tmp,i; char str[30]; printf("Enter any string: "); gets(str); for(i=0; str[i]!='\0'; i++) { if(str[i-1]==' ' i==0) { if(str[i]>='a' && str[i]<='z') str[i]=str[i]-32; else if(str[i]>='A' && str[i]<='Z') str[i]=str[i]+32; } printf("%c",str[i]); } getch(); return 0;}
The gcvt() function converts a floating-point number to a string. It converts given value to a null-terminated string.example....#include #include int main(void) { char str[25]; double num; int sig = 5; /* significant digits */ /* a regular number */ num = 9.876; gcvt(num, sig, str); printf("string = %s\n", str); /* a negative number */ num = -123.4567; gcvt(num, sig, str); printf("string = %s\n", str); /* scientific notation */ num = 0.678e5; gcvt(num, sig, str); printf("string = %s\n", str); return(0); }Output:string = 9.876string = -123.46string = 67800
int mystrlen (char* str) { int len = 0; while (*str++ != '\0') len++; return len; }
#include<stdio.h> void main() { int str[20],str1[20],i,j=1; printf("enter the string"); gets(str); for(i=1;str[i]!='\0';i++) { str1[j]=str[i]; j++; } if(str1[j]!='\0') { puts(str1); } getch(); }
RemoveSpaces (char *str) { char *new = str; while (*str != '\0') { if (*str != ' ') *(new++) = *str; str++; } *new = '\0'; }