Answers for "string"

C++
11

strings in python

#A string is a type of data. There are many data types. It can be manipulated.
#It can be storerd as a variable
myString = "Hello world"
#WE can print it:
print(myString)
#You can append it to arraY:
myArr = []
myArr.append(myString)
#You can find the index of a character in a string:
H = myString[0]
#You can use methods on it:
lowercase = myString.lower()
#You can convert it into a integer provided it is a numerical string
myInt = int(myString)
#So thats the basics, hope i haven't left anything out.
Posted by: Guest on July-26-2020
1

string

Input: strings: "XXXXZY", "XXY", "XXZ"
Output: XXXXZY is interleaved of XXY and XXZ
The string XXXXZY can be made by 
interleaving XXY and XXZ
String:    XXXXZY
String 1:    XX Y
String 2:  XX  Z

Input: strings: "XXY", "YX", "X"
Output: XXY is not interleaved of YX and X
XXY cannot be formed by interleaving YX and X.
The strings that can be formed are YXX and XYX
Posted by: Guest on September-18-2021
1

string

#include <iostream>
int main()
{
	using namespace std;

	char name[20];       //declaring string 'name'

	cin.getline(name, sizeof(name)); //taking string input
	cout << name << endl; //printing string
	return 0;
}
Posted by: Guest on April-20-2021
0

string

char c[] = "c string";
Posted by: Guest on October-08-2021
0

string

x = str("s1") # x will be 's1'

y = str(2)    # y will be '2'

z = str(3.0)  # z will be '3.0'
Posted by: Guest on July-30-2021
0

string frase

Hola que tal
Posted by: Guest on November-27-2020

Browse Popular Code Answers by Language