strings's questions - English 1answer

2.129 strings questions.

Remove Last Comma

14 answers, 35.311 views java strings
I want to join strings together, but when doing this it often happens that there is a comma too many, and therefore I need to remove that comma. In this code, I use the ...

I am currently studying Latin from Wheelock's Latin. Given that a core component of language learning is memorizing vocabulary I needed somewhere I could memorize vocabulary, online, namely Quizlet (...

From LeetCode medium 3. Longest Substring Without Repeating Characters: Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", ...

I have created a brute-force algorithm class in C# and I was wondering if I could speed up the process of creating a new string. There are two methods inside the class: one returns the brute-force ...

I'm pretty new to large projects, and usually my code is neat and manageable. But now that I'm about a month deep, things are starting to seem sloppy (or at least not aesthetically pleasing). Are ...

I did my code for "Bronze Challenge: Disallow Alphabetic characters" exercise in "iOS programming" book by Big Nerd Ranch (p.85). When I did the exercise I also changed code of func textField which ...

I wrote a simple program to print out any vowels found in a string, as well as the amount of times that vowel occurs. Here is my code: ...

I'm pretty new to Java and I've been trying to use top-down design and make my code very readable, so I would appreciate any comments as to the clarity and efficiency of this program. Looking for ...

The objective is as follows : Implement atoi which converts a string to an integer. The function first discards as many whitespace characters as necessary until the first non-whitespace character is ...

I had this idea of trying to re-implement the function String.prototype.indexOf in a way that could potentially be faster than the native function. With some ...

I know there is a simpler way of doing this, but I just really can't think of it right now. Can you please help me out? ...

Below is my method to find the longest substring having k distinct characters. I have used Set to keep track of distinct ...

The code is meant to find the longest substring that is in alphabetical order. I would like to know if I can do it more efficiently than I have done here. I am in my first week of my first ...

I have a set of functions that retrieve words from some arbitrary dictionary based on what letters they have. For example, this function gets words that use only the specified letters: ...

I have an exercise in my ANSI C book: 3.3. Write a function expand(s1,s2) that expands shorthand notations like a-z in the string s1 into the equivalent complete list abc…xyz in s2. Allow for ...

The goal is to split a URL like http://q.com/a/b/c to: ['http://q.com/a', 'http://q.com/a/b', 'http://q.com/a/b/c']My code: ...

This is my first module I wrote in Rust. I'm new to the language and couldn't find a way to easily replace some words in a file, so that's my go at it. If there's already something like that and I ...

This console application uses the Rich Edit Form Input procedure for which you can find the source here. It presents the user with a dialog that has 5 input boxes and 2 buttons. The dialog is drawn ...

...

Context: I have a program which stores data to the disk. The data is then reprocessed during some of the iterations. Thus, it needs to store, search and load set of data. Let's consider the ...

I often need to write string processing functions that take an input string and transform that into some output string. I'm looking for a pattern to make such functions as generic as possible (with ...

I tried coding this for practice. Is there a more memory-efficient way to work in place without using more arrays etc (using raw array operations)? ...

Counting letters in a string

3 answers, 46.674 views python strings
This little program is self-explanatory. I count letters in a string (can be any string), using a for loop to iterate through each letter. The problem is that this ...

VBA has built-in functions for repeating a single character: Function String$(Number As Long, Character) As String ...

I want to make this code: ...

I am solving interview questions from here. Problem : Given an integer n, generate the nth count and say sequence. The count-and-say sequence is the sequence of integers beginning as follows: <...

I am trying to split a string so that the first word goes into the first span, and the remaining (an unknown number of words) goes into the next. This currently works fine, but is there an easy / ...

On some video from CPPcon, some one said that there should be variadic overload for operator+ as it can solve allocation when there are multiple ...

This is my first attempt at writing some reusable OOP code. The problem I'm trying to simplify is the confusing (at least to me) structure of VBA string manipulation. Example ...

I wrote implementation of unix console program word count "wc" in Java. Please evaluate it. Is there any better solution? ...

Given an expression string exp, write a program to examine whether the pairs and the orders of"{","}","(",")","[","]" are correct in exp. For example,...

The exercise is from a Java-course in which I'm enrolled. The classes Book and APIResponseParser were provided by the instructor. For Book I had to add just a few getter- and setter-methods. For ...

I'd like to write a function to split strings in C++ to check my template learning. I've also read some relavent questions in this site but most of them don't use templates or ...

This is an extension method to get a string that is truncated to a maximum length. Any comments? ...

I need to find the substrings within my array. If I have an array: ["abc", "abcd", "abcde", "xyz"], my method should return the array members: ...

I've got a string that has values that are delimited by comma's, like so:$var = '1,23,45,123,145,200';I'd like to get just the first value, so what I do is ...

I recently did a little task for fun that required me to create a class to determine if a word is a palindrome or not. I know this is quite simple, but I'd be interested to know if a real developer (I'...

Some people are telling me that using string.Split is very inefficient since it creates a lot of arrays in the heap. So, what are the alternatives if its real? The challenge? Taking a large string ...

I wrote my Split() extension, it's main goal is to save delimiters and add them to splitted strings. For example: I have a string ...

I have a dataset of around 200,000 tweets. I am running a classification task on them. Dataset has two columns - class label and the tweet text. In the preprocessing step I am passing the dataset ...

I am working with some Java code. Basically I have a wrapper class that holds a string and implements some of the many useful python string methods in Java. My goal here is to implement the Python ...

I have a data structure called ClientSession which I convert to a String separated by | for ...

I attempted a problem from the Cracking the Coding Interview book. The following input: aabcccaaa should give the following output: ...

I want to check if a string contains only a single occurrence of the given substring (so the result of containsOnce("foo-and-boo", "oo") should be ...

I am working on a compiler that does a pretty heavy work on strings in order to get them correctly displayed. So far I have an algorithm that transforms a given string like (In plaintext): ...

I created this small function just to practice C code. It's a simple random string generator. ...

This is a small program written for a small assignment to check spelling. The assignment asks for the following output: A list of words that are misspelled in the file A count of the ...

I am working on a program that is meant to fold a large input line into smaller ones. Basic flow of the program would be as follows: User calls the program with a long string as input Program prints ...

I currently have this encoding function which simply subtracts one from each character code: ...

Any improvements? Please review. It could be faster if I use own strstr function which searches from the end (less memory to move) but I wanted to use only the ...

Related tags

Hot questions

Language

Popular Tags