Category "string"

Remove trailing substring from String in Java

I am looking to remove parts of a string if it ends in a certain string. An example would be to take this string: "[email protected]" And remove the @2x.p

Is there a way to match patterns from one column to other one?

I want to use club position and check if preferred_position contain the string then return True/False value for each row. Club_position Preferred_position RM R

Creating a powershell function that will take on ONE parameter and outputs a concatenated string value (fname+lname)

I'm looking for some guidance or tips for how to revise the function below. My goal is create a function that accepts one parameter and then returns a string. I

iOS: Recieveing a crash NSInvalidArgumentException NSConcreteMutableAttributedString addAttribute:value:range:: nil value

This is the line that the error is occurring on. [self addAttribute:(__bridge NSString*)kCTForegroundColorAttributeName value:(__bridge id)color.CGColor range

Rewriting strlen() in C [closed]

if anyone has ever wanted to try and rewrite a string function in C, would this code work to replace the standard strlen() function? I have no

Need to check that braces in given array are balanced or not

Braces in a string are considered to be balanced if they met the following conditions, All braces must be closed. braces come in a pair of the form of (), {},

Java: Print a unique character in a string

I'm writing a program that will print the unique character in a string (entered through a scanner). I've created a method that tries to accomplish this but I ke

Why is my code for Codingbat String-2 EndOther not working?

I won't lie, this is sort of homework for my AP Computer Science class. But I talked to my teacher, and he couldn't figure it out either. So I'm doing the Java

Read and write a String from text file

I need to read and write data to/from a text file, but I haven't been able to figure out how. I found this sample code in the Swift's iBook, but I still don't

Python get string from an html page

I have to create an array which contains all the element within title="", for example: title="xxxxx", title="xxx2", title='xxx4', etc... I need to get xxxx,

How to convert list of bytes (unicode) to Python string?

I have a list of bytes (8 bit bytes, or in C/C++ language they form wchar_t type string), they form an UNICODE string (byte by byte), how to convert those value

Making multiple assignments to objects named as strings

We can assign a value to a single object using that object's name - assign("x", 1) - and we can efficiently assign different values to multiple object thanks to

How to compare more than 2 strings in C?

I know there is the strcmp but it just let me compare two strings, And I need to compare a lot of them This one doesn't work: if(strcmp (resposta, "S" || "s"

Incompatible operand types char and string - JAVA

The program compares a character to a String and counts the number of times that character repeats in the String. Line 8 gives error "Incompatible operand types

Multiplying strings in bash script

I know that if I do print ("f" + 2 * "o") in python the output will be foo. But how do I do the same thing in a bash script?

Counting the number of occurrences of a string within a string

What's the best way of counting all the occurrences of a substring inside a string? Example: counting the occurrences of Foo inside FooBarFooBarFoo

Regex match whole string

I have the following pattern: [ \n\t]*([a-zA-Z][a-zA-Z0-9_]*)[ \n\t]+((char)[ \n\t]*\[[ \n\t]*([0-9]+)[ \t\n]*\]|(char)|(int)|(double)|(bool)|(blob)[ \n\t]*\[

Why is capitalizing the first letter of a string so convoluted in Rust?

I'd like to capitalize the first letter of a &str. It's a simple problem and I hope for a simple solution. Intuition tells me to do something like this: le

Extract string between the tags in Java

I have string like below Msg_Begin Some message1 Msg_End Msg_Begin Some message2 Msg_End Msg_Begin Some message3 Msg_End And want to get the message between

String comparison time complexity

Which comparison would take longer time? a = helloworldhelloworldhelloworldb = https://www.somerandomurls.com/directory/anotherdirectory/helloworld.htmlif a !=