Category "string"

Resource String Color not working programmatically in Android

string.xml Here is my string <string name="bullet_text"><font color="#38d98a">●</font>\t\tCucumber Detox Water (1 glass)\n<font color

From snake_case to camelCase in Java

Can anyone tell me how to convert a string in snake_case as: camel_case to a string in camelCase as: camelCase in Java? Thank you in advance.

Find index of numbers from a string in Javascript

I would like to get the index of numbers ( 1994 and 27 ) in the string bellow i tried to split the string but no idea what to do after that let str = 'year o

How to convert String into Hex nodejs

I was looking for some standard function like hex to string but inverse, I want to convert String to Hex, but I only found this function... // Example of conve

Convert string to lowercase AND then convert it to its original form in PHP, is it possible?

I need to convert input data to lower and then return it in it's original form with PHP, is it impossible or does anyone have a solution? thank you. ps, i'm

F String With Special Characters

I want to print the following using an f string literal. It will be running wihtin a function and apples will be one of the arguments. I want it to have the squ

Regular Expression to search longest word in a string

I have a string: var str = "Lorem ipsum dolor sit amet, consectetur adipiscing elit"; Is there a way to find the longest word in a string using regex? This w

Convert a mat-datepicker into a String

I'm trying to have a reactive form in which there is some dates that are entered by the user using mat-datepicker. The problem I face is that the output of the

String iterator in swift

I try to create an iterator for string processing in swift that will return every time the next chracter. But with no luck. (The final goal is to write a parser

Leetcode word ladder : How is this solution most efficient?

I'm doing this question in Leetcode : https://leetcode.com/problems/word-ladder/ My solution was a BFA approach, and only one nested loop: def ladderLength(self

Unicode to Arabic Win1256

I have Unicodes in my Database which were encoded from Arabic and I need some source code to convert it to actual Arabic. I have tried a lot of codes but not wo

Check if a permutation of a string can become a palindrome

Write a method to test if a string meets the preconditions to become a palindrome. Eg: Input | Output mmo | True yakak | True travel |

Valid Braces - CodeWars Challenge

There is a challenge on codewars that asks you to check whether a string of parentheses, brackets, and curly braces is valid. A string of braces is consider

Valid Braces - CodeWars Challenge

There is a challenge on codewars that asks you to check whether a string of parentheses, brackets, and curly braces is valid. A string of braces is consider

Sending string using i2c commuication on two arduino micro-controller

i am using two arduino mcu to connect two lines of LED-matrix display. I tried using i2c communication to connect a master mcu (which controls the first line of

pandas dataframe replace blanks with NaN

I have a dataframe with empty cells and would like to replace these empty cells with NaN. A solution previously proposed at this forum works, but only if the ce

Why does this function that removes the first occurrence of a string from another string not work correctly?

I tried to write a function that removes the first occurrence of a string from another string: def removesubstr(substr, x): a = len(substr) m = "" c

Sorting an array of strings in C++

I am trying to accomplish the following task: List the students in alphabetic order, sorted by last name. Do not change the given case of the names. Do not ch

Which is the best way to append single quotes for a String in java

For example, String x= "ABC"; Which is the best way to convert ABC to 'ABC' ?

convert string to hex in lua?

I am going to send a byte array through socket.But I used to work in c/c++ and be new to lua. Now i have a problem,here is my question. i want to send a bytear