Tags » String

String arrangement.

I
IN
IND
INDI
INDIA
INDIA
INDI
IND
IN
I

#include
#include
void main()
{
int i,j,n;
char c[]={‘I’,’N’,’D’,’I’,’A’};
clrscr();
for(i=0;i<5;i++)
{
for(j=0;j<=i;j++) printf(“%c”,c[j]); printf(“\n”); } for(i=4;i>=0;i–) 13 more words

PATTERNS

Java : remove starting/ending spaces from string

Use

.trim()

Eg:

public class MewanthaWrites{
   public static void main(String args[]){
      String temp = new String("   Mewantha Writes   ");
      System.out.println(temp .trim() );
   }
}
Remove

Rust : get characters from a string through iterations

Say you have a string “Hello world!” and you want to get each character one by one. You can use code like this.

fn main() {

    let s1 = "Hello world!".to_string();

for letter in s1.chars().enumerate() {
    println!("{:?}", letter );
    let (_, l) = letter;
    println!("{:?}", l );
  }
} 61 more words
Rust

YoYo


I was the string
Always the solid one
I could be stretched thin
And still stand strong

Yo!

You slid through me
You climbed up me… 16 more words

Feelings

How to convert a String to an Integer in c ( without using any pre-defined functions) ?

#include
#include

int main(){

char str[] = “-1234″;

int sign,offset;

if(str[0] == ‘-‘) // check in case it is a -ive number

sign = 1; 60 more words

Computer

String

String

Package: java.lang.String

Super Class: java.lang.Object

Interfaces Implemented: Serializable, CharSequence, Comparable

Is Class Final: Yes

How to Define: String name =”Java”;

The String class represents character strings. 117 more words

Java

turtle beach life...

Am back on Happy Beach for a short spell, and summer has truly set in! Hot nights and hotter days, thankfully there is a constant breeze from the sea and plenty of rock pools to cool you down. 143 more words

Bottle Tops