Abcz following are bcz graphical non control

  • No School
  • AA 1
  • madhumg145
  • 3
  • 100% (1) 1 out of 1 people found this document helpful

This preview shows page 1 - 3 out of 3 pages.

a=("bcz following are bcz graphical (non-control) characters defined by ISO 8859-1. Descriptions in words aren't all that helpful, but they're bcz best we can do in text. A graphics file illustrating bcz character set should be available from bcz same archive as this file.") #Using stringr library library(stringr)#package stringr to manipulate string stringr = str_replace_all(string=a,pattern="bcz",replacement = "because") stringr #Using gsub test <- "high five to edwisor bcz they are doing good work" gsub("bcz", "because", test) Python Code: In Python same can be achieved by using string.replace() function.
Image of page 1
#Here's our text a = ('bcz following are bcz graphical (non-control) characters defined bcz') a 'bcz following are bcz graphical (non-control) characters defined bcz' #Using replace method #The syntax of replace() is:str.replace(old, new [, count]) a = a.replace('bcz', 'because') a 'because following are because graphical (non-control) characters defined because' #Replace using dictionary if there are more than one word to replace #Building dictionary consisting of key as word to match and value as word to replace dic = {'bcz':'because'} text = ('bcz following are bcz graphical (non-control) characters defined bcz')
Image of page 2
Image of page 3

You've reached the end of your free preview.

Want to read all 3 pages?

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture