строки

Find the occurrence of a substring in a string in C

Please tell me: there are two arrays of characters that are entered by the user, you need to check them character by characte ... // функция вывода. { index == NULL ? printf("str1 not in str2") : printf("str1 in str2, entry index is: %d", index); }

Convert std:: string to std:: wstring

How do I translate std::string to std::wstring? Admit: std::string s = "some string"; std::wstring ws = f(s); How can f() be implemented?

How do I categorize a string based on the presence of a given group of extraneous characters?

I have a function that accepts a string. The string passed to the function can be: Consist entirely of letters (Russian or ... - Pi !!!") Out[64]: 3 # Буквы + какие-то символы In [65]: str_category("3.1415, -{}[]) !!!") Out[65]: 2 # Какие-то символы

First character of the string

Background: The database stores the full name. Task It is necessary to print "Surname And. O." Problem The string is stored ... am, 0, 2), but if the string contains English letters, it will give 2 characters. What is the best way to solve this problem?

How to split by the '\'character in js

I'm trying to split a string by the character \, it doesn't work, I tried \\ the same thing, just the whole string is returne ... Who knows how to do it? Maybe with regulars somehow? let a = "ABC\EG\SSDF\NSDFSD\SDFSDF".split("\\"); console.log(a);

How to pull 1 character in a php string?

There is a string $text="Текс"; How to pull out 1 character? Have you tried echo $text[0] or $text{0} iconv("UTF-8", "window ... text[0]); Returns nothing at alliconv("windows-1251", "UTF-8", $text[0]); result � But if echo $text; the text of the norms

Convert a string to a number

How to use PHP to turn a string into a number? The string is stored in a separate variable. I tried it like this: $var1="1"; ... 2; But in the end, the layout via echo showed that: 1 0 That is, $var2=0, and why is not clear. Please explain and tell me!

How do I delete the first character in a string with replace()?

The function replace() takes the following arguments in my case: str.replace(old, new), where old is the element in the strin ... i", and still replaces all the "i". It is allowed to use other functions, but I would like it with replace(), is it possible?

Cut off milliseconds from TimeSpan

Good day, Hashcode. I have an application in which a simple media player is implemented using the WPF MediaElement. There is ... re-I don't know. PS. As you can see from the code, there is a combination of WPF and WinForms, please do not swear at this :)

Overloading a string class

Forumchane, please help with the task. I do not understand how to overload some of the operators. Here is the problem conditi ... ; return 0;} } } I don't understand how to overload the other operators.... Please help me, I will be very grateful.

How to trim a string in python to the desired character from the end

Given a string: a = 'Первый - второй - третий' How can I trim a string from the end to ' - ' to get: 'Первый - второй' ... - '), but delete not specifically [1], but just the last item in the resulting list. Who knows how to do it? Tell me, please.

Count the number of occurrences of a substring in a string

I have two variables: text and text2. The text variable is assigned the string that the user enters, and text2 is assigned th ... in the string text. This is what the variables look like: String t = reader.readLine(); String t2 = "get out of my swamp";

Clearing a string in javascript: removing spaces, tabs

Is it possible to clear the string by removing duplicate spaces, tabs, and line feeds, in general, so that the string is like ... for this, but it will then remove just spaces at the end and beginning of the string. Maybe there is a plugin, or a function?

Replacing a substring (variable) in a string

There is a string. You need to replace one word with another in it. Difficulties arise when you need to not just change one w ... one variable in the string to another. I hope I explained it clearly. If not-write, I will try to explain it better. Thanks!

How do I convert an array of characters to an array of strings?

How can I convert an array of characters to an array of strings? For example, "Text not text" → "Text not text" как массив ... temp[i] = new String(chList); } } System.out.println(temp[i]); } } }

Flip all words of a string

It is necessary to turn over each word in the line entered by the user, for example Привет Мир ⇒ тевирП риМ. I tried to write ... rray[j]; array[j] = t; i++; j--; } return String.valueOf(array); } }

How to compare strings ignoring diacritics?

The user enters the string Arke. I need to compare it with the string Arkè, so that they are equal. The word Arkè with a diacritic mark is just an example. we need a solution that will work with such diacritics.

Read access violation at address 0x00000000

#include <iostream> #include <string> struct Auto { std::string Manufacturer; std::string TitleModel; ... exception was raised at 0x0F7AF6E0 (ucrtbased.dll) in Task2.37.exe: 0xC0000005: read access violation at address 0x00000000.

Strange behavior of the str.rstrip() method in Python 3.7

Solving a problem from Yandex.The lyceum is faced with a curious problem. The fact is that when trying to trim the string "ni ... m. In this regard, the question:What is the reason for this behavior of the interpreter and how is this problem explained?

How to shuffle words in a php string

Help me solve the problem. There is a string, let's say: "Nikolai Petrovich Bondarenko". We need an array in which the words ... an consist of not only of three words (maybe two words, or maybe five). I.e., you need all the options for alternating words.