strings's questions - English 1answer

2.167 strings questions.

My server code is currently reading String data over a TCP connection form 2 different client computers. To do this I am duplicating the ...

I want to write a function that gets a string of hex numbers (two hex numbers represent a u8 value) then returns a vector of u8 ...

I made a function to embolden text that doesn't match a string, but it appears to be very performance-heavy. I am certain that there are much better ways to do this, but with what I tried, I ran into ...

Mad Libs program that reads in text files and lets the user add their own text anywhere the word ADJECTIVE, NOUN, ADVERB, or VERB appears in the text file. ...

Word Inverter in C

5 answers, 2.383 views beginner c strings
I've just made this program and I want to know how to improve it. It just receives a word and prints it backwards. Sequences of numbers are also accepted, but not white spaces (that's why I used scanf)...

I am coming from a Ruby background and I am learning Python. This is a method I've created to generate a URL safe unique key: ...

A utility method StringUtils.replace to replace multiple search strings simultaneously. I'm looking for a review of any and all aspects, but especially: Is there's ...

So I've been trying to check through a string, looping for, [ (start) and ] (end). In this, I also have to check for nested ...

I have 4 functions that process texts or tweepy.models.Status object (this object stores text information, author information, retweets & likes information of a ...

The following function is designed to accept a string of characters and an integer. The function returns a string that's a reordered version of the original string. The reordering process is ...

This is a question in the book "Cracking The Coding Interview". Design an algorithm and write code to remove the duplicate characters in a string without using any additional buffer. NOTE: One ...

I had to do a CLI script that does something, I also had to add a validation that checks if it runs inside the Docker. After a research I found a solution that people check some processes via ...

This is legacy, so I'm not really looking for improvements on architectural approach. Here's what the method does: Extracts filename from a string containing full file path (passed in as parameter) ...

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)? ...

I wrote this function in order to create unique url's for my site. Using these urls, visitors could demo site functionality without having to create a login. The function was intended to return a ...

I want to take the capitalization of one string and apply it to another. For example: take Apple and orange and turn that into <...

I completed the challenge and passed the tests: Perform a search and replace on the sentence using the arguments provided and return the new sentence. First argument is the sentence to perform ...

I want to detect $number substring in std::string and then replace it with $number + 1. For ...

This is my first algorithm in C++ ever to check if two strings are permutations of each other. Please provide guidance on correctness of algorithm + ways to improve + thoughts on my use of the ...

This is a question from the book "Cracking the Coding Interview". Write code to reverse a C-Style String (C-String means that “abcd” is represented as five characters, including the null ...

Please critique this very, very basic routine which returns the length of a given char buffer or "string." ...

I find this Substring Leetcode challenge online. Given a string S and a string T, find the minimum window in ...

Consider the following string in javascript:var string="border-radius:90px 20px 30px 40px";I want to extract the 4 numbers from that string and store them in ...

I was selected for the third round of MS internships for third years. We were surprisingly asked a very easy question: “Make a program that counts the number of times the WORD "a" or "A" occurs”. I ...

In my scenario I have list of object in C# code and need to be converted into JavaScript object. But there are certain condition, where the value of the object might be dynamic based on certain key. ...

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: ...

Given a string S, find the number of "unordered anagrammatic pairs" of substrings. Input Format First line contains ...

I'm new to Java and am trying to solve a scenario. Even though I've succeeded and it works, I've just wondered if there was a more practical way of doing this task. Is there a quicker or more ...

Given a string, reverse only the vowels present in it and print the resulting string. Input: First line of the input file contains an integer T denoting the number of test ...

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 ...

This is the question; https://www.hackerrank.com/challenges/ctci-ransom-note/problem I have solved this hacker rank challenge but i feel like the complexity is pretty inefficient because i use two ...

This class has the responsibility of parsing a string to one of the primitive types: int, double, ...

Any improvements that I can make with this code? Also, is there another way to convert a vector to a string variable without using a for ranged-based loop? From the posts I've seen for converting, I ...

I would like some feedback on what I should change with my semi remake of std::to_string with UDLs (user-defined literals). This is compiled and working on linux ...

This is a code that allows a swimmer to know his position with respect to other competitors. It gets the swimmer's time from the meet's website, finds other competitors' times and shows the better ...

Given two strings, check whether two given strings are anagram of each other or not. An anagram of a string is another string that contains same characters, only the order of characters can be ...

Two solutions to check if a String contains unique characters. Wanted to know if these solutions can be optimized further. The Code: ...

I have the following function to replace all the occurrence of a string that matches certain token. ...

Problem This code is meant to solve the problem in this software engineering question. To summarize the issue: given a set of strings that are sort of similar, but not similar enough to use regex ...

This is a toy project and I am a beginner in Python. I need to create 10 random 3-letter strings, where characters are a - z. ...

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 ...

I wrote this code for printing all sets of a String. It also prints the empty subset. Is this the right approach ...

Generic Case Converter

2 answers, 198 views c++ strings
After receiving advice from my last question, I reworked the design of my program to be more generic, expandable and easier to use. This is the excerpt of the requirements: Step 1: Basic Title ...

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 second attempt after I started to learn about STL. I am oblivious and need suggestions/advices on if there can be improvements made on this code. ...

I am trying to solve a puzzle in a performant way. This is the puzzle. Simply explained: you have a String and you must reduce it to one character with the given rules. This is the solution to the ...

I wrote an algorithm that solves this problem but I would love to get some feedback on it (especially since I'm not so confident in my Big \$O\$ skills). Do you think this is a good quality algorithm?...

Title Case Converter

2 answers, 529 views c++ strings
I wrote a program that, given a string of text, converts it to Title Case based on certain criteria. I would mainly like to know how I could improve readability and expressiveness, make a more clear ...

Since the previous question I posted here was not found as interesting as I expected, I decided to post a new one. I made a function solely for the purpose of having fun. That is, a function that ...

I came across a problem that needs to reverse each word in a string without affecting space in it. For example, if a string has two spaces between the word, the answer needs to have space between two ...

Related tags

Hot questions

Language

Popular Tags