Public Questions for tag [string]

Ask Question

6 questions


0

Vote

4

Answers

36

View

I'm looking for a string.contains or string.indexof method in Python.I want to do:if not somestring.contains("blah"): continue

Jan 25

0

Vote

4

Answers

118

View

I have the following code in Ruby. I want to convert this code into JavaScript. What is the equivalent code in JS?text = <<"HERE" This Is A Multiline String HERE

Jan 17

0

Vote

4

Answers

34

View

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.Is == bad? When should it an

Jan 10

0

Vote

4

Answers

31

View

How do I make the first letter of a string uppercase, but not change the case of any of the other letters?For example:"this is a test" → "This is a test""the Eiffel Tower" → "The Eiffel Tower""/in

0

Vote

4

Answers

38

View

I have this string in my JavaScript code:"Test abc test test abc test test test abc test test abc"Doing:str = str.replace('abc', '');Seems to only remove the first occurrence of abc in the string abov

Dec 31

0

Vote

3

Answers

28

View

Usually, I would expect a String.contains() method, but there doesn't seem to be one.What is a reasonable way to check for this?

Dec 23