Category "string"

Why does this selectizeInput minimum values function not work correctly for 2 digit numbers even though it works fine for single digit numbers?

This one has me puzzled. The below code extract uses selectizeInput() to allow the user to choose to/from periods for purposes of data analysis (latter not show

How to shuffle strings in arrays in golang?

So I created a program to help me decide which game to play. Before I start my problem let me show you my code: package main import ( "fmt" "strconv"

Using Python to find drive letter (Windows)

I'm trying to write a python script (I'm a newbie) that will search the root directory of each connected drive on Windows for a key file and then return the dri

Why are some characters ignored when calling LastIndexOf?

Please take a look at these codes : string str_to_find = "➖➖➖➖➖➖➖➖➖➖\r\n"; string str

[]byte(string) vs []byte(*string)

I'm curious as why Go doesn't provide a []byte(*string) method. From a performance perspective, wouldn't []byte(string) make a copy of the input argument and ad

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?