• Register

Recent questions tagged string

0 votes
1 answer 1 view
Problem: How to fix this error: python plot line with slope and intercept HELP! I need help understanding this error: python plot line with slope and intercept Can someone please help fix this, I am new in python() : python plot line with slope and intercept
asked 15 hours ago Mashhoodch 9.6k points
0 votes
1 answer 1 view
Problem: Why I got the error : exception in thread "main" java.lang.stringindexoutofboundsexception: string index out of range: 1 HELP! I need help understanding this error. Can someone please help fix this, I am new in java: exception in thread "main" java.lang.stringindexoutofboundsexception: string index out of range: 1 Any anyone ideas on what I need to do to fix this? Thanks!
asked 17 hours ago Ali 5.1k points
0 votes
1 answer 1 view
Problem: Why I got the error : write the code to take a string and print it with one letter per line. How to fix this error: write the code to take a string and print it with one letter per line. HELP! I need help understanding this error write the code to take a string and print it with one letter per line. Any anyone ideas on what I need to do to fix this? Thanks!
asked 18 hours ago Ali 5.1k points
0 votes
1 answer 2 views
Problem: How to append to a string in python ?
asked 22 hours ago Ashty 1.5k points
0 votes
1 answer 3 views
Problem: I am trying to write a java program to create an ArrayList, add all the months of a year, and print the months. I have successfully written a program by initializing a string array with names of the months and then adding the months in ArrayList by using a for a loop. But I want to know, is there any efficient way of doing this? A demo program would be much helpful. Thanks!
asked 1 day ago Code Learner 6k points
0 votes
1 answer 2 views
Problem: How to write a program that finds the duplicate words and their number of occurrences in a string? I am a beginner with no prior experience in programming so facing some difficulty in developing logic. Please help. Thanks!
asked 1 day ago Code Learner 6k points
0 votes
1 answer 2 views
Problem: Why I got the error : remove first and last character from string python Any ideas on what I need to do to fix this? Thanks! Can someone please help fix this, remove first and last character from string python
asked 1 day ago Mashhoodch 9.6k points
0 votes
1 answer 2 views
Problem: By using StringBuffer we can insert char at the beginning, middle and end of a string. For insert at the end of a StringBuffer, we can use this method: str. append(ch); can you anyone explain
asked 1 day ago Ali 5.1k points
0 votes
1 answer 3 views
Problem: I have recently learned about the functions in C++ and I want to write a function that has three string parameters and returns the smallest string of all according to its length. How can I do that? This question might seem nonsense so I apologize for being so dumb. Thanks!
asked 2 days ago Code Learner 6k points
0 votes
1 answer 3 views
Problem: Hello! I need to write a program that takes string input from the user and removes all the spaces from the string. Following is my attempt. It is not giving the desired output: #include <iostream> #include <string.h> using namespace std; int main() { ... following output: Enter a sentence:This is My Program This I do not understand why this is not printing the whole sentence. Any help?
asked 2 days ago Code Learner 6k points
0 votes
1 answer 3 views
Problem: How can I convert string into int after taking input ?
asked 2 days ago Ashty 1.5k points
0 votes
1 answer 7 views
Problem: Hello! I just started learning programming in Java with no prior knowledge of any other programming language. Today I attempted a quiz in which there was a question that asked me to declare a string variable and name it as &lsquo;title&rsquo;. I attempted the ... follows: string title; I have not worked with strings alot. So want to know whether my answer is correct or not? Thanks!
asked 4 days ago Code Learner 6k points
0 votes
1 answer 4 views
Problem: In Java 8 &middot; Convert the specified primitive array to a sequential Stream using Arrays. stream() &middot; Box each element of the Stream to an Integer using IntStream. Get the set of integers. Convert Set of Integer to Stream of Integer. This is done using Set. stream(). Convert Stream of Integer to IntStream. Convert IntStream to int[].
asked 4 days ago Ali 5.1k points
0 votes
1 answer 2 views
Problem: What I'd like to know is if the cost of repeatedly calling the charAt method during a long iteration ends up being either less than or greater than the cost of performing a single call to toCharArray at the beginning and then directly accessing the array ... in mind JIT warm-up time, JVM start-up time, etc. and not just the difference between two calls to System.currentTimeMillis().
asked 4 days ago Ali 5.1k points
0 votes
1 answer 6 views
Problem: I can convert String to char in java using charAt() method of String class. The charAt() method returns a single character only.I want To get all characters, you can use loop.
asked 4 days ago Ali 5.1k points
0 votes
1 answer 4 views
Problem: My string contains numbers and I want to return the number it represents.
asked 5 days ago Ashty 1.5k points
0 votes
1 answer 3 views
Problem: By using StringBuffer we can insert char at the beginning, middle and end of a string. For insert at the end of a StringBuffer, we can use this method: str. append(ch); Can you add a char to a string in Java? How do you add a character to a string? How do I add special characters to a string in Java? How do I add a character to a string array in Java?
asked 5 days ago Ali 5.1k points
0 votes
1 answer 5 views
Problem: Python String isnumeric() Method The isnumeric() method returns True if all the characters are numeric (0-9), otherwise False. Exponents, like &sup2; and &frac34; are also considered to be numeric values. then how check if a string is a number python
asked 5 days ago Mashhoodch 9.6k points
0 votes
1 answer 4 views
Problem: I want to learn how to break(or split) a String into characters. The end result can be an array of characters or an array of Strings which contain characters?A String is a sequence of characters. But unlike C++, Strings in Java are not mutable. Which means that Strings cannot be changed or modified?
asked 5 days ago Ali 5.1k points
0 votes
1 answer 3 views
Problem: I am working on exercise 41 in learnpythonthehardway and keep getting the error: Traceback (most recent call last): File ".\url.py", line 72, in <module> question, answer = convert(snippet, phrase) File ".\url.py", line 50, in convert result = result ... TypeError: Can't convert 'bytes' object to str implicitly I am using python3 while the books uses python2, so I have made some changes.
asked 6 days ago Mashhoodch 9.6k points