PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, November 3, 2022

[FIXED] How to Split a String Up into Individual Characters

 November 03, 2022     array-formulas, google-sheets, lambda, regex, split     No comments   

Issue

Using array formula, how to divide each character into a cell.

Input   Output                                              
cat     c   a   t                                       
dog     d   o   g                                       
horse   h   o   r   s   e                               
tiger   t   i   g   e   r                               

Solution

Here's another possible solution.

=ArrayFormula(
 Iferror(split(regexreplace(A2:A,
               "(.)","$1❄️"),"❄️"),""))

enter image description here

This formula uses REGEXREPLACE to insert a placeholder character after each character, and it SPLITs by it.

ARRAYFORMULA - IFERROR - SPLIT - REGEXREPLACE



Answered By - ztiaa
Answer Checked By - Gilberto Lyons (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing