![]() |
Здравствуйте, гость ( Вход | Регистрация )
![]() ![]() |
![]() |
pelican |
![]() ![]()
Сообщение
#1
|
Студент ![]() Группа: Участник Сообщений: 15 Регистрация: 31.8.2009 Из: Россия, г. Кострома. Пользователь №: 1038 Спасибо сказали: 0 раз(а) Репутация: ![]() ![]() ![]() |
Привет всем! Подскажите, пожалуйста, функцию в QString, которая является аналогом функции copy() в std::string. Спасибо.
string::copy() string::copy public member function size_t copy ( char* s, size_t n, size_t pos = 0) const; Copy sequence of characters from string Copies a sequence of characters from the string content to the array pointed by s. This sequence of characters is made of the characters in the string that start at character position pos and span n characters from there. The function does not append a null character after the content copied. To retrieve a temporary c-string value from a string object, a specific member function exists: c_str. Parameters s Array where the sequence of characters is copied. The storage space of the array shall already be allocated and should be large enough to contain n characters. n Number of characters to be copied. If this number is greater than the amount of characters between pos and the end of the string content, only those characters between pos and the end of the string are copied. pos Position of the first character to be copied from the string. out_of_range is thrown if pos>size(). Return Value The effective length of the sequence of characters copied to s. This may either be equal to parameter n or to size()-pos, whichever is smaller (see description of parameter n). size_t is an unsigned integral type. |
|
|
Litkevich Yuriy |
![]()
Сообщение
#2
|
![]() разработчик РЭА ![]() ![]() ![]() ![]() ![]() ![]() ![]() Группа: Сомодератор Сообщений: 9669 Регистрация: 9.1.2008 Из: Тюмень Пользователь №: 64 Спасибо сказали: 807 раз(а) Репутация: ![]() ![]() ![]() |
|
|
|
pelican |
![]()
Сообщение
#3
|
Студент ![]() Группа: Участник Сообщений: 15 Регистрация: 31.8.2009 Из: Россия, г. Кострома. Пользователь №: 1038 Спасибо сказали: 0 раз(а) Репутация: ![]() ![]() ![]() |
|
|
|
BRE |
![]()
Сообщение
#4
|
![]() Профессионал ![]() ![]() ![]() ![]() ![]() Группа: Участник Сообщений: 1112 Регистрация: 6.3.2009 Из: Ростов-на-Дону Пользователь №: 591 Спасибо сказали: 264 раз(а) Репутация: ![]() ![]() ![]() |
|
|
|
Litkevich Yuriy |
![]()
Сообщение
#5
|
![]() разработчик РЭА ![]() ![]() ![]() ![]() ![]() ![]() ![]() Группа: Сомодератор Сообщений: 9669 Регистрация: 9.1.2008 Из: Тюмень Пользователь №: 64 Спасибо сказали: 807 раз(а) Репутация: ![]() ![]() ![]() |
В дополнении к тому, что сказал BRE, Манипуляции со строками в нашей вики
|
|
|
pelican |
![]()
Сообщение
#6
|
Студент ![]() Группа: Участник Сообщений: 15 Регистрация: 31.8.2009 Из: Россия, г. Кострома. Пользователь №: 1038 Спасибо сказали: 0 раз(а) Репутация: ![]() ![]() ![]() |
|
|
|
![]() ![]() ![]() |
![]() |
Текстовая версия | Сейчас: 20.3.2025, 2:20 |