• Register

Recent questions tagged string

0 votes
1 answer 3 views
Problem: I have been learning C# and got an assignment in which I have to read a string as input from a user and then check if it contains a digit or not. If it contains a digit, a bool variable must be set to true, or else it must remain false. After this, a validity ... of the bool variable. I have no idea how I can do this task. If any of you could help, that would be a great pleasure. Thanks!
asked 20 hours ago Sheeza 3.9k points
0 votes
1 answer 2 views
Problem: Hello Developers! I am new to the world of programming and I started learning Java at an academy. My teacher gave us an assingment in which we have to find the index of last occurrence of a character in a string. The program should return the ... those solutions. If someone has better solution then kindly explain or else please explain what substrings are and how I can use it. Thanks
asked 2 days ago Sheeza 3.9k points
0 votes
1 answer 3 views
Problem: Hi there! I am newbie and I am want to strip away specific characters from the end of a string. I am programming in C#. I have tried Remove() method as follows: using System; namespace ConsoleApp2 { class Program { static void Main(string[] args) { ... the index of string myself. I want to know that is there any way in C# to remove characters from strings without specifying the index?
asked 4 days ago Sheeza 3.9k points
0 votes
1 answer 4 views
Problem: Hi there! I am new to the world of programming. My programming teacher gave me an assignment in which I have to write a program in which there would be a function that will take two strings as input from user and will compare the size of both strings ... the larger string of the two. I have no clue how to do that. Please provide me with the sample program with proper description. Thanks
asked 5 days ago Sheeza 3.9k points
0 votes
1 answer 3 views
Problem: Hi there! I am working with enumerations in C# and I am trying to check whether certain string exists in my enumeration or not. I am using ‘if’ condition with == operator but the compiler is giving some error and I am not getting the desired output. How can I convert a string to enumeration in order to check whether it exists in enum or not?
asked Nov 24 Sheeza 3.9k points
0 votes
1 answer 4 views
Problem hey, i was trying to take each letter in a string and print it&rsquo;s ASCII. but, something getting wrong when threre is a space. here&rsquo;s my code. #include <iostream> #include <string> using namespace std; void convertToASCII(string letter) { for (int i ... plainText); return 0; } tell me why this is happening with this code. you can pass on any solution with some keypoint clearance.
asked Nov 20 chris jordan 440 points
0 votes
1 answer 4 views
problem I need to know that how do we convert string to lowercase in c++
asked Nov 20 chris jordan 440 points
0 votes
1 answer 12 views
Convert string to char array in C++ I encountered the error 'cannot convert std::string to char[] or char* data type.' How can I solve it? Thanks!
asked Nov 15 miki 1.5k points
0 votes
1 answer 13 views
Problem: Hello developer, I have seen the following line of code to check if a string contains certain characters or not. static void Main(string[] args) { string s = "Thermometer"; bool str = s.Contains("meter", StringComparison.OrdinalIgnoreCase); Console.WriteLine(str); ... it was. Please tell me what is the problem with my code and explain if there is any alternative way to do so. Thanks!
asked Nov 14 Sheeza 3.9k points
0 votes
1 answer 10 views
Problem I need to clean string from unnecessary characters, which are brought by users via UI. For instance the system got the following input from a user: Berry @GSC,accepts.OR1245; I need to get : Berry GSC accepts OR1245;
asked Nov 7 alexh 1.6k points
0 votes
1 answer 5 views
Problem: Given a string as an input. We need to write a program that will print all non-empty substrings of that given string. Examples : Input : abcd how We can run three nested loops, the outermost loop picks starting character, mid loop considers all characters on right of the picked character as ending character of substring.
asked Nov 5 Mashhoodch 1.2k points
0 votes
1 answer 12 views
Problem: C ++ program that reads a flat file (mycode.txt) with the sequence ATCGGATCGCCAATGCGGATGCTTTATAATCCGTA # ( It is a file created in notepad with the name mycode.txt and is located in the folder where my compiler saves the cpp and exe ) The program must store the sequence in a char type array ... +) arr [i] = l.toCharArray (); } } int main () { file sequence; file.Open (); return 0; } `` ''
asked Nov 5 sasha 2.3k points
0 votes
1 answer 6 views
Problem: Hi, How can you remove whitespace from a char * string? Something like: char * a = (char *) malloc (256); // somehow we get a = << a without trailing blanks >>? strcat (.......... Thanks and best regards :) __________________ Han Li
asked Nov 5 Han Li 710 points
0 votes
1 answer 6 views
Problem: How to Get the list of String. How to Convert List of String to List of Integer using Lists. transform(). This is done using passing Integer. parseInt() method as lambda expression for transformation. How to Return/Print the list of String.
asked Nov 5 Mashhoodch 1.2k points
0 votes
1 answer 10 views
0 votes
1 answer 9 views
0 votes
1 answer 8 views
0 votes
1 answer 5 views
0 votes
1 answer 6 views
0 votes
1 answer 8 views