Home
Blogs
Questions
Jobs
Monetize

Home

About Us

Blogs

Questions

Jobs

Monetize

Post Job

banner

Questions about strsplit

Read more about strsplit

python (12.9k questions)

javascript (9.2k questions)

reactjs (4.7k questions)

java (4.2k questions)

java (4.2k questions)

c# (3.5k questions)

c# (3.5k questions)

html (3.3k questions)

Questions - strsplit

How do I sum the numbers of a string vertically?

I'm trying to add all the numbers in a string in the Python language. For example, s="""11 9 5 6 6 8 4 6 4""" If we considered this string in 3 lines, and eac...
test-img

Seyed Amir Vahabi

python

string

methods

str-replace

strsplit

Votes: 0

Answers: 4

Latest Answer

This is not a one-line, but it is readable v = list(map(int, s.split())) # col_size = int(len(v)**0.5) col_size = len(s.split("\n")[0].split()) res = [0]*col_size for i in range(0, len(v)):...
test-img

dabdya

Split string and concatenate removing whole word in R

I am trying to remove the words "Arts and Humanities" and "Social Sciences" from a string containing concatenated by "/" different disciplines of knowledge as follows: st...
test-img

monteromati

r

stringr

strsplit

Votes: 0

Answers: 2

Latest Answer

One way would be separate the whole string and then exclude that part that you are not interested in: paste0(unlist(strsplit(string, '/'))[!unlist(strsplit(string, '/')) %in% c("Arts and Humaniti...
test-img

AlexB

Posts

Questions

Blogs

Jobs

The ultimate platform for coders and IT specialists

About

  • Company
  • Support

  • Platform

  • Terms & Conditions
  • Privacy statement
  • Cookie policy
  • Cookie option
  • OnlyCoders © 2025  |  All rights reserved