Category "string"

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 !=

Hex String to Byte array conversion java

I know this question is asked a lot of times but please hear me out. Previously I have tried following methods to convert hex string to byte array. say my key

Most efficient string similarity metric function

I am looking for an efficient implementation of a string similarity metric function in Python (or a lib that provides Python bindings). I want to compare strin

Pascal 'Split' Function

I am coding a little program in pascal and I have run into a small problem. In other languages there is a function named 'split' or 'explode' to take a long str

How can I fill empty space with null in a pdf? using pdfbox

I am using Java PDFBOX to read a pdf It is a very long pdf with more than 40 pages, and I need to extract more than 100 elements on each page, doing it manually

Isn't a 2-byte char datatype insufficient to deal with the concept of "characters" in a Unicode string?

Various programming languages use a 2-byte char datatype (not to be confused with C/C++'s char, which is just one byte) out of which strings are constructed. Va

Initialize a String from a range of Characters in Swift

In our code, we found a bug from not writing the alphabet correctly. Instead of "0123456789abcdefghijklmnopqrstuvwxyz", we had "0123456789abcdefghijklmnoqprstuv

Javascript: find all occurrences of word in text document

I'm trying to write a Javascript function to find indices of all occurrences of a word in a text document. Currently this is what I have-- //function that find

How can I check the first character in a string in Bash or Unix shell?

I'm writing a script in Unix where I have to check whether the first character in a string is "/" and if it is, branch. For example, I have a string: /some/dire

string split with expand=True. Can anyone explain what is the meaning?

all_data['Title']= all_data['Name'].str.split(', ', expand=True)[1].str.split('.', expand=True)[0] Can anyone explain what is the meaning of this line of code?