String splitting divides a string around a delimiter and returns the resulting elements as a list. In Cypher, split(string, delimiter) turns tweet text into tokens that can be filtered or transformed. section 7.1
A practical hashtag-extraction pipeline uses string splitting as one transformation step:
- Replace newline characters with spaces to create cleaner text. section 7.1
- Split the cleaned text on spaces, producing a list of tokens. section 7.1
- Use list comprehension to keep tokens beginning with #, remove commas, and lowercase them. section 7.1
- Use size() to discard tweets whose resulting hashtag list is empty. section 7.1
Extract hashtags from tweet text
WITH t, replace(t.text, '\n', ' ') AS cleanText WITH t, split(cleanText, ' ') AS tokens WITH t, [el IN tokens WHERE el STARTS WITH "#" | toLower(replace(el, ",", ""))] AS hashtags WHERE size(hashtags) > 0 RETURN hashtags LIMIT 5 This produces lists such as ["#sql", "#code", "#datascience", "#ai", "#ml"]. section 7.1
View the compact syntax reference for split(string, delimiter). section 7.1










