Remove first letter from output

shv22

How do I remove first letter from this string

d[],e[], [dsh,sj]

I get this by doing an analysis but now I need to remove first letter before every comma(,). So,I storing it and applying for loop but it is giving me error.

*Uncaught SyntaxError: Unexpected token [*

But I am not understanding why?

EDIT : I know how to remove element but here I am not able to declare it

Expected Output :  [],[],[dsh,sj]
ppasler

Just to make sure we are talking about the same things:

var s = "hello"; // a String, notice the quotes
var a = [] // an empty Array
var b = ["hello", "bye"] // an Array with 2 elements

If this is your input:

var inpt = "d[],e[], [dsh,sj]";
var otpt = inpt.replace(/.\[/g,"["); // returns '[],[],[dsh,sj]' but as data type String

// this block is not very clean...
var splt = otpt.replace(/],/g, "],,");
splt = splt.split(",,");

var arr = [];
splt.forEach(function(value) {
  value = value.replace(/\[|\]/g,"");
  if (value === "") {
	value = [];
  } else {
	value = value.split(",");
  }
  arr.push(value);
});

console.log(arr); // [[],[],["dsh","sj"]]

I would recommend to have a look at this: http://www.w3schools.com/js/default.asp

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Remove first letter of several filenames

From Dev

How to remove first occurrence of a letter?

From Dev

bash - how to remove first 2 lines from output

From Dev

How to remove a first character of that particular sentences from a list of output

From Dev

Remove First 8 columns from ls Output with AWK

From Dev

Javascript, Array first letter get from letter to letter

From Dev

PHP First Letter Uppercase of Each Word In Output

From Dev

Extract substring from the first letter

From Dev

Remove a letter from a character array

From Dev

Remove path from output

From Dev

Separate first letter from String for capitalization

From Dev

Get first letter of a string from column

From Dev

cmd: Find first letter from a string

From Dev

Identify first letter from every word in a TextBox

From Dev

Regex to Identify Month from the first 3 letter

From Dev

Trying to remove a letter from a string in Python 3

From Dev

how do i remove a letter from string

From Dev

ng-repeat : output only unique first letter filter

From Dev

Form validation submission and First letter capitalized in output of submission of Name and City

From Dev

how to remove first letter if it's vowel and return no vowels if there is no vowel

From Dev

How to sort vowels and consonants by letter that comes out first and remove "space"

From Dev

Remove all uppercase letters in a string except the first letter using perl

From Dev

how to remove first letter if it's vowel and return no vowels if there is no vowel

From Dev

How to remove first Cyrillic letter in string using PHP

From Dev

Remove first letter in element with Javascript (ES6)

From Dev

how to remove first two words of a strings output

From Dev

Remove quote from the JSONArray output

From Dev

Remove input from an output stream

From Dev

remove \r\n from output

Related Related

  1. 1

    Remove first letter of several filenames

  2. 2

    How to remove first occurrence of a letter?

  3. 3

    bash - how to remove first 2 lines from output

  4. 4

    How to remove a first character of that particular sentences from a list of output

  5. 5

    Remove First 8 columns from ls Output with AWK

  6. 6

    Javascript, Array first letter get from letter to letter

  7. 7

    PHP First Letter Uppercase of Each Word In Output

  8. 8

    Extract substring from the first letter

  9. 9

    Remove a letter from a character array

  10. 10

    Remove path from output

  11. 11

    Separate first letter from String for capitalization

  12. 12

    Get first letter of a string from column

  13. 13

    cmd: Find first letter from a string

  14. 14

    Identify first letter from every word in a TextBox

  15. 15

    Regex to Identify Month from the first 3 letter

  16. 16

    Trying to remove a letter from a string in Python 3

  17. 17

    how do i remove a letter from string

  18. 18

    ng-repeat : output only unique first letter filter

  19. 19

    Form validation submission and First letter capitalized in output of submission of Name and City

  20. 20

    how to remove first letter if it's vowel and return no vowels if there is no vowel

  21. 21

    How to sort vowels and consonants by letter that comes out first and remove "space"

  22. 22

    Remove all uppercase letters in a string except the first letter using perl

  23. 23

    how to remove first letter if it's vowel and return no vowels if there is no vowel

  24. 24

    How to remove first Cyrillic letter in string using PHP

  25. 25

    Remove first letter in element with Javascript (ES6)

  26. 26

    how to remove first two words of a strings output

  27. 27

    Remove quote from the JSONArray output

  28. 28

    Remove input from an output stream

  29. 29

    remove \r\n from output

HotTag

Archive