get first x characters of string python
characters = 4
string = "This is a string"
print(string[:characters])
#output: 'This'
get first x characters of string python
characters = 4
string = "This is a string"
print(string[:characters])
#output: 'This'
Get the First and Last Word from a String or Sentence
DECLARE @Sentence VARCHAR(MAX) = 'The quick brown fox jumps over the lazy dog'
SELECT SUBSTRING(@Sentence, 1, CHARINDEX(' ', @Sentence) - 1) AS [First Word],
REVERSE(SUBSTRING(REVERSE(@Sentence), 1, CHARINDEX(' ', REVERSE(@Sentence)) - 1)) AS [Last Word]
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us